Current File : /var/www/vinorea/modules/autoupgrade/views/js/autoupgrade.js |
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
var t,e,n,r,s,o,i,a,c,u,l,d,h,p,f,m,g,y,v,_,b,E,w,S,k,x,R,O,T,L,A,C,N,P,D,I,M,j,U,F,W,B,q,H,G,V,z,J,K,Y,X,Q,Z,tt,et,nt,rt,st,ot,it,at,ct,ut,lt,dt,ht,pt,ft,mt,gt,yt,vt,_t,bt,Et,wt,St,kt,xt,Rt,Ot,Tt,Lt,At,Ct,Nt,Pt,Dt,It,Mt,jt,$t,Ut,Ft,Wt,Bt,qt,Ht,Gt,Vt,zt,Jt,Kt,Yt,Xt,Qt,Zt,te,ee,ne,re,se,oe,ie,ae,ce,ue,le,de,he,pe,fe,me,ge,ye,ve,_e,be,Ee,we,Se,ke,xe,Re,Oe,Te,Le,Ae,Ce,Ne,Pe,De,Ie,Me,je,$e,Ue,Fe,We,Be,qe,He,Ge=Object.defineProperty,Ve=t=>{throw TypeError(t)},ze=(t,e,n)=>((t,e,n)=>e in t?Ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n),Je=(t,e,n)=>e.has(t)||Ve("Cannot "+n),Ke=(t,e,n)=>(Je(t,e,"read from private field"),n?n.call(t):e.get(t)),Ye=(t,e,n)=>e.has(t)?Ve("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Xe=(t,e,n,r)=>(Je(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Qe=(t,e,n)=>(Je(t,e,"access private method"),n);import{A as Ze}from"../assets/segment-analytics-next-B8n1BW-_.js";import"../assets/segment-analytics-core-Cvc9gLK6.js";import"../assets/segment-analytics-generic-utils-EvPM-36Q.js";import"../assets/segment-facade-GjXxjz1z.js";import"../assets/segment-isodate-CDrC9DRV.js";import"../assets/segment-isodate-traverse-DVAtc24X.js";var tn=(t=>(t.PAGE="PAGE",t.DIALOG="DIALOG",t))(tn||{});function en(t,e){return function(){return t.apply(e,arguments)}}const{toString:nn}=Object.prototype,{getPrototypeOf:rn}=Object,sn=(t=>e=>{const n=nn.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),on=t=>(t=t.toLowerCase(),e=>sn(e)===t),an=t=>e=>typeof e===t,{isArray:cn}=Array,un=an("undefined");const ln=on("ArrayBuffer");const dn=an("string"),hn=an("function"),pn=an("number"),fn=t=>null!==t&&"object"==typeof t,mn=t=>{if("object"!==sn(t))return!1;const e=rn(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},gn=on("Date"),yn=on("File"),vn=on("Blob"),_n=on("FileList"),bn=on("URLSearchParams"),[En,wn,Sn,kn]=["ReadableStream","Request","Response","Headers"].map(on);function xn(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,s;if("object"!=typeof t&&(t=[t]),cn(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),o=s.length;let i;for(r=0;r<o;r++)i=s[r],e.call(null,t[i],i,t)}}function Rn(t,e){e=e.toLowerCase();const n=Object.keys(t);let r,s=n.length;for(;s-- >0;)if(r=n[s],e===r.toLowerCase())return r;return null}const On="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Tn=t=>!un(t)&&t!==On;const Ln=(t=>e=>t&&e instanceof t)("undefined"!=typeof Uint8Array&&rn(Uint8Array)),An=on("HTMLFormElement"),Cn=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Nn=on("RegExp"),Pn=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};xn(n,((n,s)=>{let o;!1!==(o=e(n,s,t))&&(r[s]=o||n)})),Object.defineProperties(t,r)};const Dn=on("AsyncFunction"),In=(Mn="function"==typeof setImmediate,jn=hn(On.postMessage),Mn?setImmediate:jn?($n=`axios@${Math.random()}`,Un=[],On.addEventListener("message",(({source:t,data:e})=>{t===On&&e===$n&&Un.length&&Un.shift()()}),!1),t=>{Un.push(t),On.postMessage($n,"*")}):t=>setTimeout(t));var Mn,jn,$n,Un;const Fn="undefined"!=typeof queueMicrotask?queueMicrotask.bind(On):"undefined"!=typeof process&&process.nextTick||In,Wn={isArray:cn,isArrayBuffer:ln,isBuffer:function(t){return null!==t&&!un(t)&&null!==t.constructor&&!un(t.constructor)&&hn(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||hn(t.append)&&("formdata"===(e=sn(t))||"object"===e&&hn(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&ln(t.buffer),e},isString:dn,isNumber:pn,isBoolean:t=>!0===t||!1===t,isObject:fn,isPlainObject:mn,isReadableStream:En,isRequest:wn,isResponse:Sn,isHeaders:kn,isUndefined:un,isDate:gn,isFile:yn,isBlob:vn,isRegExp:Nn,isFunction:hn,isStream:t=>fn(t)&&hn(t.pipe),isURLSearchParams:bn,isTypedArray:Ln,isFileList:_n,forEach:xn,merge:function t(){const{caseless:e}=Tn(this)&&this||{},n={},r=(r,s)=>{const o=e&&Rn(n,s)||s;mn(n[o])&&mn(r)?n[o]=t(n[o],r):mn(r)?n[o]=t({},r):cn(r)?n[o]=r.slice():n[o]=r};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&xn(arguments[s],r);return n},extend:(t,e,n,{allOwnKeys:r}={})=>(xn(e,((e,r)=>{n&&hn(e)?t[r]=en(e,n):t[r]=e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let s,o,i;const a={};if(e=e||{},null==t)return e;do{for(s=Object.getOwnPropertyNames(t),o=s.length;o-- >0;)i=s[o],r&&!r(i,t,e)||a[i]||(e[i]=t[i],a[i]=!0);t=!1!==n&&rn(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:sn,kindOfTest:on,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(cn(t))return t;let e=t.length;if(!pn(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:An,hasOwnProperty:Cn,hasOwnProp:Cn,reduceDescriptors:Pn,freezeMethods:t=>{Pn(t,((e,n)=>{if(hn(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];hn(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return cn(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:Rn,global:On,isContextDefined:Tn,isSpecCompliantForm:function(t){return!!(t&&hn(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(fn(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const s=cn(t)?[]:{};return xn(t,((t,e)=>{const o=n(t,r+1);!un(o)&&(s[e]=o)})),e[r]=void 0,s}}return t};return n(t,0)},isAsyncFn:Dn,isThenable:t=>t&&(fn(t)||hn(t))&&hn(t.then)&&hn(t.catch),setImmediate:In,asap:Fn};function Bn(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}Wn.inherits(Bn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Wn.toJSONObject(this.config),code:this.code,status:this.status}}});const qn=Bn.prototype,Hn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{Hn[t]={value:t}})),Object.defineProperties(Bn,Hn),Object.defineProperty(qn,"isAxiosError",{value:!0}),Bn.from=(t,e,n,r,s,o)=>{const i=Object.create(qn);return Wn.toFlatObject(t,i,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),Bn.call(i,t.message,e,n,r,s),i.cause=t,i.name=t.name,o&&Object.assign(i,o),i};function Gn(t){return Wn.isPlainObject(t)||Wn.isArray(t)}function Vn(t){return Wn.endsWith(t,"[]")?t.slice(0,-2):t}function zn(t,e,n){return t?t.concat(e).map((function(t,e){return t=Vn(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const Jn=Wn.toFlatObject(Wn,{},null,(function(t){return/^is[A-Z]/.test(t)}));function Kn(t,e,n){if(!Wn.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=Wn.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Wn.isUndefined(e[t])}))).metaTokens,s=n.visitor||u,o=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Wn.isSpecCompliantForm(e);if(!Wn.isFunction(s))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(Wn.isDate(t))return t.toISOString();if(!a&&Wn.isBlob(t))throw new Bn("Blob is not supported. Use a Buffer instead.");return Wn.isArrayBuffer(t)||Wn.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,n,s){let a=t;if(t&&!s&&"object"==typeof t)if(Wn.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(Wn.isArray(t)&&function(t){return Wn.isArray(t)&&!t.some(Gn)}(t)||(Wn.isFileList(t)||Wn.endsWith(n,"[]"))&&(a=Wn.toArray(t)))return n=Vn(n),a.forEach((function(t,r){!Wn.isUndefined(t)&&null!==t&&e.append(!0===i?zn([n],r,o):null===i?n:n+"[]",c(t))})),!1;return!!Gn(t)||(e.append(zn(s,n,o),c(t)),!1)}const l=[],d=Object.assign(Jn,{defaultVisitor:u,convertValue:c,isVisitable:Gn});if(!Wn.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!Wn.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Wn.forEach(n,(function(n,o){!0===(!(Wn.isUndefined(n)||null===n)&&s.call(e,n,Wn.isString(o)?o.trim():o,r,d))&&t(n,r?r.concat(o):[o])})),l.pop()}}(t),e}function Yn(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function Xn(t,e){this._pairs=[],t&&Kn(t,this,e)}const Qn=Xn.prototype;function Zn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function tr(t,e,n){if(!e)return t;const r=n&&n.encode||Zn;Wn.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(o=s?s(e,n):Wn.isURLSearchParams(e)?e.toString():new Xn(e,n).toString(r),o){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}Qn.append=function(t,e){this._pairs.push([t,e])},Qn.toString=function(t){const e=t?function(e){return t.call(this,e,Yn)}:Yn;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};class er{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Wn.forEach(this.handlers,(function(e){null!==e&&t(e)}))}}const nr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rr={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Xn,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},sr="undefined"!=typeof window&&"undefined"!=typeof document,or="object"==typeof navigator&&navigator||void 0,ir=sr&&(!or||["ReactNative","NativeScript","NS"].indexOf(or.product)<0),ar="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,cr=sr&&window.location.href||"http://localhost",ur={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:sr,hasStandardBrowserEnv:ir,hasStandardBrowserWebWorkerEnv:ar,navigator:or,origin:cr},Symbol.toStringTag,{value:"Module"})),...rr};function lr(t){function e(t,n,r,s){let o=t[s++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),a=s>=t.length;if(o=!o&&Wn.isArray(r)?r.length:o,a)return Wn.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!i;r[o]&&Wn.isObject(r[o])||(r[o]=[]);return e(t,n,r[o],s)&&Wn.isArray(r[o])&&(r[o]=function(t){const e={},n=Object.keys(t);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],e[o]=t[o];return e}(r[o])),!i}if(Wn.isFormData(t)&&Wn.isFunction(t.entries)){const n={};return Wn.forEachEntry(t,((t,r)=>{e(function(t){return Wn.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null}const dr={transitional:nr,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,s=Wn.isObject(t);s&&Wn.isHTMLForm(t)&&(t=new FormData(t));if(Wn.isFormData(t))return r?JSON.stringify(lr(t)):t;if(Wn.isArrayBuffer(t)||Wn.isBuffer(t)||Wn.isStream(t)||Wn.isFile(t)||Wn.isBlob(t)||Wn.isReadableStream(t))return t;if(Wn.isArrayBufferView(t))return t.buffer;if(Wn.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Kn(t,new ur.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return ur.isNode&&Wn.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((o=Wn.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Kn(o?{"files[]":t}:t,e&&new e,this.formSerializer)}}return s||r?(e.setContentType("application/json",!1),function(t,e){if(Wn.isString(t))try{return(e||JSON.parse)(t),Wn.trim(t)}catch(n){if("SyntaxError"!==n.name)throw n}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||dr.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(Wn.isResponse(t)||Wn.isReadableStream(t))return t;if(t&&Wn.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(s){if(n){if("SyntaxError"===s.name)throw Bn.from(s,Bn.ERR_BAD_RESPONSE,this,null,this.response);throw s}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ur.classes.FormData,Blob:ur.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Wn.forEach(["delete","get","head","post","put","patch"],(t=>{dr.headers[t]={}}));const hr=Wn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pr=Symbol("internals");function fr(t){return t&&String(t).trim().toLowerCase()}function mr(t){return!1===t||null==t?t:Wn.isArray(t)?t.map(mr):String(t)}function gr(t,e,n,r,s){return Wn.isFunction(r)?r.call(this,e,n):(s&&(e=n),Wn.isString(e)?Wn.isString(r)?-1!==e.indexOf(r):Wn.isRegExp(r)?r.test(e):void 0:void 0)}let yr=class{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function s(t,e,n){const s=fr(e);if(!s)throw new Error("header name must be a non-empty string");const o=Wn.findKey(r,s);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||e]=mr(t))}const o=(t,e)=>Wn.forEach(t,((t,n)=>s(t,n,e)));if(Wn.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(Wn.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))o((t=>{const e={};let n,r,s;return t&&t.split("\n").forEach((function(t){s=t.indexOf(":"),n=t.substring(0,s).trim().toLowerCase(),r=t.substring(s+1).trim(),!n||e[n]&&hr[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e);else if(Wn.isHeaders(t))for(const[i,a]of t.entries())s(a,i,n);else null!=t&&s(e,t,n);return this}get(t,e){if(t=fr(t)){const n=Wn.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(Wn.isFunction(e))return e.call(this,t,n);if(Wn.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=fr(t)){const n=Wn.findKey(this,t);return!(!n||void 0===this[n]||e&&!gr(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function s(t){if(t=fr(t)){const s=Wn.findKey(n,t);!s||e&&!gr(0,n[s],s,e)||(delete n[s],r=!0)}}return Wn.isArray(t)?t.forEach(s):s(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const s=e[n];t&&!gr(0,this[s],s,t,!0)||(delete this[s],r=!0)}return r}normalize(t){const e=this,n={};return Wn.forEach(this,((r,s)=>{const o=Wn.findKey(n,s);if(o)return e[o]=mr(r),void delete e[s];const i=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(s):String(s).trim();i!==s&&delete e[s],e[i]=mr(r),n[i]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Wn.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&Wn.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[pr]=this[pr]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=fr(t);e[r]||(!function(t,e){const n=Wn.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,s){return this[r].call(this,e,t,n,s)},configurable:!0})}))}(n,t),e[r]=!0)}return Wn.isArray(t)?t.forEach(r):r(t),this}};function vr(t,e){const n=this||dr,r=e||n,s=yr.from(r.headers);let o=r.data;return Wn.forEach(t,(function(t){o=t.call(n,o,s.normalize(),e?e.status:void 0)})),s.normalize(),o}function _r(t){return!(!t||!t.__CANCEL__)}function br(t,e,n){Bn.call(this,null==t?"canceled":t,Bn.ERR_CANCELED,e,n),this.name="CanceledError"}function Er(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new Bn("Request failed with status code "+n.status,[Bn.ERR_BAD_REQUEST,Bn.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}yr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Wn.reduceDescriptors(yr.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),Wn.freezeMethods(yr),Wn.inherits(br,Bn,{__CANCEL__:!0});const wr=(t,e,n=3)=>{let r=0;const s=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s,o=0,i=0;return e=void 0!==e?e:1e3,function(a){const c=Date.now(),u=r[i];s||(s=c),n[o]=a,r[o]=c;let l=i,d=0;for(;l!==o;)d+=n[l++],l%=t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),c-s<e)return;const h=u&&c-u;return h?Math.round(1e3*d/h):void 0}}(50,250);return function(t,e){let n,r,s=0,o=1e3/e;const i=(e,o=Date.now())=>{s=o,n=null,r&&(clearTimeout(r),r=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),a=e-s;a>=o?i(t,e):(n=t,r||(r=setTimeout((()=>{r=null,i(n)}),o-a)))},()=>n&&i(n)]}((n=>{const o=n.loaded,i=n.lengthComputable?n.total:void 0,a=o-r,c=s(a);r=o;t({loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&o<=i?(i-o)/c:void 0,event:n,lengthComputable:null!=i,[e?"download":"upload"]:!0})}),n)},Sr=(t,e)=>{const n=null!=t;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},kr=t=>(...e)=>Wn.asap((()=>t(...e))),xr=ur.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,ur.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(ur.origin),ur.navigator&&/(msie|trident)/i.test(ur.navigator.userAgent)):()=>!0,Rr=ur.hasStandardBrowserEnv?{write(t,e,n,r,s,o){const i=[t+"="+encodeURIComponent(e)];Wn.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),Wn.isString(r)&&i.push("path="+r),Wn.isString(s)&&i.push("domain="+s),!0===o&&i.push("secure"),document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Or(t,e,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&r||0==n?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Tr=t=>t instanceof yr?{...t}:t;function Lr(t,e){e=e||{};const n={};function r(t,e,n,r){return Wn.isPlainObject(t)&&Wn.isPlainObject(e)?Wn.merge.call({caseless:r},t,e):Wn.isPlainObject(e)?Wn.merge({},e):Wn.isArray(e)?e.slice():e}function s(t,e,n,s){return Wn.isUndefined(e)?Wn.isUndefined(t)?void 0:r(void 0,t,0,s):r(t,e,0,s)}function o(t,e){if(!Wn.isUndefined(e))return r(void 0,e)}function i(t,e){return Wn.isUndefined(e)?Wn.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(n,s,o){return o in e?r(n,s):o in t?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(t,e,n)=>s(Tr(t),Tr(e),0,!0)};return Wn.forEach(Object.keys(Object.assign({},t,e)),(function(r){const o=c[r]||s,i=o(t[r],e[r],r);Wn.isUndefined(i)&&o!==a||(n[r]=i)})),n}const Ar=t=>{const e=Lr({},t);let n,{data:r,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:c}=e;if(e.headers=a=yr.from(a),e.url=tr(Or(e.baseURL,e.url),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Wn.isFormData(r))if(ur.hasStandardBrowserEnv||ur.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[t,...e]=n?n.split(";").map((t=>t.trim())).filter(Boolean):[];a.setContentType([t||"multipart/form-data",...e].join("; "))}if(ur.hasStandardBrowserEnv&&(s&&Wn.isFunction(s)&&(s=s(e)),s||!1!==s&&xr(e.url))){const t=o&&i&&Rr.read(i);t&&a.set(o,t)}return e},Cr="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){const r=Ar(t);let s=r.data;const o=yr.from(r.headers).normalize();let i,a,c,u,l,{responseType:d,onUploadProgress:h,onDownloadProgress:p}=r;function f(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=yr.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Er((function(t){e(t),f()}),(function(t){n(t),f()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:t,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Bn("Request aborted",Bn.ECONNABORTED,t,m)),m=null)},m.onerror=function(){n(new Bn("Network Error",Bn.ERR_NETWORK,t,m)),m=null},m.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||nr;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),n(new Bn(e,s.clarifyTimeoutError?Bn.ETIMEDOUT:Bn.ECONNABORTED,t,m)),m=null},void 0===s&&o.setContentType(null),"setRequestHeader"in m&&Wn.forEach(o.toJSON(),(function(t,e){m.setRequestHeader(e,t)})),Wn.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),p&&([c,l]=wr(p,!0),m.addEventListener("progress",c)),h&&m.upload&&([a,u]=wr(h),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(i=e=>{m&&(n(!e||e.type?new br(null,t,m):e),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);y&&-1===ur.protocols.indexOf(y)?n(new Bn("Unsupported protocol "+y+":",Bn.ERR_BAD_REQUEST,t)):m.send(s||null)}))},Nr=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,r=new AbortController;const s=function(t){if(!n){n=!0,i();const e=t instanceof Error?t:this.reason;r.abort(e instanceof Bn?e:new br(e instanceof Error?e.message:e))}};let o=e&&setTimeout((()=>{o=null,s(new Bn(`timeout ${e} of ms exceeded`,Bn.ETIMEDOUT))}),e);const i=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(s):t.removeEventListener("abort",s)})),t=null)};t.forEach((t=>t.addEventListener("abort",s)));const{signal:a}=r;return a.unsubscribe=()=>Wn.asap(i),a}},Pr=function*(t,e){let n=t.byteLength;if(n<e)return void(yield t);let r,s=0;for(;s<n;)r=s+e,yield t.slice(s,r),s=r},Dr=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},Ir=(t,e,n,r)=>{const s=async function*(t,e){for await(const n of Dr(t))yield*Pr(n,e)}(t,e);let o,i=0,a=t=>{o||(o=!0,r&&r(t))};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await s.next();if(e)return a(),void t.close();let o=r.byteLength;if(n){let t=i+=o;n(t)}t.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:t=>(a(t),s.return())},{highWaterMark:2})},Mr="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,jr=Mr&&"function"==typeof ReadableStream,$r=Mr&&("function"==typeof TextEncoder?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Ur=(t,...e)=>{try{return!!t(...e)}catch(n){return!1}},Fr=jr&&Ur((()=>{let t=!1;const e=new Request(ur.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),Wr=jr&&Ur((()=>Wn.isReadableStream(new Response("").body))),Br={stream:Wr&&(t=>t.body)};var qr;Mr&&(qr=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!Br[t]&&(Br[t]=Wn.isFunction(qr[t])?e=>e[t]():(e,n)=>{throw new Bn(`Response type '${t}' is not supported`,Bn.ERR_NOT_SUPPORT,n)})})));const Hr=async(t,e)=>{const n=Wn.toFiniteNumber(t.getContentLength());return null==n?(async t=>{if(null==t)return 0;if(Wn.isBlob(t))return t.size;if(Wn.isSpecCompliantForm(t)){const e=new Request(ur.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return Wn.isArrayBufferView(t)||Wn.isArrayBuffer(t)?t.byteLength:(Wn.isURLSearchParams(t)&&(t+=""),Wn.isString(t)?(await $r(t)).byteLength:void 0)})(e):n},Gr={http:null,xhr:Cr,fetch:Mr&&(async t=>{let{url:e,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:h}=Ar(t);u=u?(u+"").toLowerCase():"text";let p,f=Nr([s,o&&o.toAbortSignal()],i);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(c&&Fr&&"get"!==n&&"head"!==n&&0!==(g=await Hr(l,r))){let t,n=new Request(e,{method:"POST",body:r,duplex:"half"});if(Wn.isFormData(r)&&(t=n.headers.get("content-type"))&&l.setContentType(t),n.body){const[t,e]=Sr(g,wr(kr(c)));r=Ir(n.body,65536,t,e)}}Wn.isString(d)||(d=d?"include":"omit");const s="credentials"in Request.prototype;p=new Request(e,{...h,signal:f,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:s?d:void 0});let o=await fetch(p);const i=Wr&&("stream"===u||"response"===u);if(Wr&&(a||i&&m)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=o[e]}));const e=Wn.toFiniteNumber(o.headers.get("content-length")),[n,r]=a&&Sr(e,wr(kr(a),!0))||[];o=new Response(Ir(o.body,65536,n,(()=>{r&&r(),m&&m()})),t)}u=u||"text";let y=await Br[Wn.findKey(Br,u)||"text"](o,t);return!i&&m&&m(),await new Promise(((e,n)=>{Er(e,n,{data:y,headers:yr.from(o.headers),status:o.status,statusText:o.statusText,config:t,request:p})}))}catch(y){if(m&&m(),y&&"TypeError"===y.name&&/fetch/i.test(y.message))throw Object.assign(new Bn("Network Error",Bn.ERR_NETWORK,t,p),{cause:y.cause||y});throw Bn.from(y,y&&y.code,t,p)}})};Wn.forEach(Gr,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(n){}Object.defineProperty(t,"adapterName",{value:e})}}));const Vr=t=>`- ${t}`,zr=t=>Wn.isFunction(t)||null===t||!1===t,Jr=t=>{t=Wn.isArray(t)?t:[t];const{length:e}=t;let n,r;const s={};for(let o=0;o<e;o++){let e;if(n=t[o],r=n,!zr(n)&&(r=Gr[(e=String(n)).toLowerCase()],void 0===r))throw new Bn(`Unknown adapter '${e}'`);if(r)break;s[e||"#"+o]=r}if(!r){const t=Object.entries(s).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));throw new Bn("There is no suitable adapter to dispatch the request "+(e?t.length>1?"since :\n"+t.map(Vr).join("\n"):" "+Vr(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Kr(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new br(null,t)}function Yr(t){Kr(t),t.headers=yr.from(t.headers),t.data=vr.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return Jr(t.adapter||dr.adapter)(t).then((function(e){return Kr(t),e.data=vr.call(t,t.transformResponse,e),e.headers=yr.from(e.headers),e}),(function(e){return _r(e)||(Kr(t),e&&e.response&&(e.response.data=vr.call(t,t.transformResponse,e.response),e.response.headers=yr.from(e.response.headers))),Promise.reject(e)}))}const Xr="1.8.2",Qr={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Qr[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const Zr={};Qr.transitional=function(t,e,n){function r(t,e){return"[Axios v1.8.2] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,s,o)=>{if(!1===t)throw new Bn(r(s," has been removed"+(e?" in "+e:"")),Bn.ERR_DEPRECATED);return e&&!Zr[s]&&(Zr[s]=!0,console.warn(r(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,s,o)}},Qr.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};const ts={assertOptions:function(t,e,n){if("object"!=typeof t)throw new Bn("options must be an object",Bn.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const o=r[s],i=e[o];if(i){const e=t[o],n=void 0===e||i(e,o,t);if(!0!==n)throw new Bn("option "+o+" must be "+n,Bn.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Bn("Unknown option "+o,Bn.ERR_BAD_OPTION)}},validators:Qr},es=ts.validators;let ns=class{constructor(t){this.defaults=t,this.interceptors={request:new er,response:new er}}async request(t,e){try{return await this._request(t,e)}catch(n){if(n instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const e=t.stack?t.stack.replace(/^.+\n/,""):"";try{n.stack?e&&!String(n.stack).endsWith(e.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+e):n.stack=e}catch(r){}}throw n}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Lr(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:s}=e;void 0!==n&&ts.assertOptions(n,{silentJSONParsing:es.transitional(es.boolean),forcedJSONParsing:es.transitional(es.boolean),clarifyTimeoutError:es.transitional(es.boolean)},!1),null!=r&&(Wn.isFunction(r)?e.paramsSerializer={serialize:r}:ts.assertOptions(r,{encode:es.function,serialize:es.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),ts.assertOptions(e,{baseUrl:es.spelling("baseURL"),withXsrfToken:es.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=s&&Wn.merge(s.common,s[e.method]);s&&Wn.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete s[t]})),e.headers=yr.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,i.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let l,d=0;if(!a){const t=[Yr.bind(this),void 0];for(t.unshift.apply(t,i),t.push.apply(t,c),l=t.length,u=Promise.resolve(e);d<l;)u=u.then(t[d++],t[d++]);return u}l=i.length;let h=e;for(d=0;d<l;){const t=i[d++],e=i[d++];try{h=t(h)}catch(p){e.call(this,p);break}}try{u=Yr.call(this,h)}catch(p){return Promise.reject(p)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(t){return tr(Or((t=Lr(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}};Wn.forEach(["delete","get","head","options"],(function(t){ns.prototype[t]=function(e,n){return this.request(Lr(n||{},{method:t,url:e,data:(n||{}).data}))}})),Wn.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,s){return this.request(Lr(s||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ns.prototype[t]=e(),ns.prototype[t+"Form"]=e(!0)}));const rs={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(rs).forEach((([t,e])=>{rs[e]=t}));const ss=function t(e){const n=new ns(e),r=en(ns.prototype.request,n);return Wn.extend(r,ns.prototype,n,{allOwnKeys:!0}),Wn.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(Lr(e,n))},r}(dr);ss.Axios=ns,ss.CanceledError=br,ss.CancelToken=class t{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,s){n.reason||(n.reason=new br(t,r,s),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let e;return{token:new t((function(t){e=t})),cancel:e}}},ss.isCancel=_r,ss.VERSION=Xr,ss.toFormData=Kn,ss.AxiosError=Bn,ss.Cancel=ss.CanceledError,ss.all=function(t){return Promise.all(t)},ss.spread=function(t){return function(e){return t.apply(null,e)}},ss.isAxiosError=function(t){return Wn.isObject(t)&&!0===t.isAxiosError},ss.mergeConfig=Lr,ss.AxiosHeaders=yr,ss.formToJSON=t=>lr(Wn.isHTMLForm(t)?new FormData(t):t),ss.getAdapter=Jr,ss.HttpStatusCode=rs,ss.default=ss;const{Axios:os,AxiosError:is,CanceledError:as,isCancel:cs,CancelToken:us,VERSION:ls,all:ds,Cancel:hs,isAxiosError:ps,spread:fs,toFormData:ms,AxiosHeaders:gs,HttpStatusCode:ys,formToJSON:vs,getAdapter:_s,mergeConfig:bs}=ss,Es=t=>{var e;return t.data||(t.data=new FormData),null==(e=t.data)||e.append("dir",window.AutoUpgradeVariables.admin_dir),t};class ws extends Error{}const Ss=t=>{var e;if(!(null==t?void 0:t.data))throw new is("The response is empty","APP_ERR_RESPONSE_EMPTY",t.config,t.request,t);if("[object Object]"!==Object.prototype.toString.call(t.data))throw new is("The response does not have a valid type","APP_ERR_RESPONSE_BAD_TYPE",t.config,t.request,t);if(!(null==(e=t.data)?void 0:e.kind))throw new is("The response contents is invalid","APP_ERR_RESPONSE_INVALID",t.config,t.request,t);return t},ks=t=>{const e=[is.ERR_CANCELED];return t instanceof is&&t.code&&e.includes(t.code)?Promise.reject(new ws):Promise.reject(t)},xs=ss.create({baseURL:`${window.AutoUpgradeVariables.admin_url}/autoupgrade/ajax-upgradetab.php`,headers:{"X-Requested-With":"XMLHttpRequest",Authorization:`Bearer ${()=>window.AutoUpgradeVariables.token}`},transitional:{clarifyTimeoutError:!0}});xs.interceptors.request.use(Es),(t=>{t.interceptors.response.use(Ss,ks)})(xs);const Rs=t=>({code:t.status,type:t.code,requestParams:t.request,additionalContents:Ts(t)}),Os=t=>"number"==typeof t&&t>=300&&3===t.toString().length,Ts=t=>{var e,n,r;return"string"==typeof(null==(e=t.response)?void 0:e.data)?null==(n=t.response)?void 0:n.data:JSON.stringify(null==(r=t.response)?void 0:r.data)};t=new WeakMap,e=new WeakSet,n=async function(t,e){"next_route"in t&&await this.post(t.next_route),"hydration"in t&&(new Bs).hydrate(t,e)},r=async function(t){(new Bs).hydrateError(Rs(t))};const Ls=new class{constructor(){Ye(this,e),Ye(this,t,null),ze(this,"abortCurrentPost",(()=>{var e;null==(e=Ke(this,t))||e.abort()}))}async post(s,o,i){this.abortCurrentPost(),Xe(this,t,new AbortController);const{signal:a}=Ke(this,t);try{const t=(await xs.post("",o,{params:{route:s},signal:a})).data;await Qe(this,e,n).call(this,t,i)}catch(c){c instanceof is&&await Qe(this,e,r).call(this,c)}}async postAction(t){const e=new FormData;e.append("action",t);try{return(await xs.post("",e)).data}catch(n){if(n instanceof is)return(t=>{var e,n;return{kind:"action",error:!0,next:"Error",stepDone:null,status:"error",next_desc:"Error",nextParams:{progressPercentage:0},nextQuickInfo:(null==(n=null==(e=t.response)?void 0:e.data)?void 0:n.nextQuickInfo)||[],apiError:Rs(t)}})(n);throw n}}},As=class t{constructor(t){this.errorElement=t}updateId(t){var e;const n=this.errorElement.getElementById("ua_error_placeholder");n&&(n.id=`ua_error_${Os(t.code)?t.code:t.type}`,n.dataset.errorCode=null==(e=t.code)?void 0:e.toString(),n.dataset.errorType=t.type)}updateLeftColumn(t){var e;if(Os(t)){const e=t.toString().replaceAll("0","O");this.errorElement.querySelectorAll(".error-page__code-char").forEach(((t,n)=>{t.innerHTML=e[n]}))}else null==(e=this.errorElement.querySelector(".error-page__code"))||e.classList.add("hidden")}updateDescriptionBlock(t){const e=this.errorElement.querySelector(".error-page__desc"),n=(null==e?void 0:e.querySelector(`.error-page__desc-${Os(t.code)?t.code:t.type}`))||(null==e?void 0:e.querySelector(".error-page__desc-unknown"));n&&n.classList.remove("hidden")}updateResponseBlock(e){const n=this.errorElement.getElementById(t.externalAdditionalContentsPanelId);n&&e&&(n.textContent=e)}};ze(As,"externalAdditionalContentsPanelId","log-additional-contents");let Cs=As;var Ns=(t=>(t.DEBUG="DEBUG",t.INFO="INFO",t.NOTICE="NOTICE",t))(Ns||{}),Ps=(t=>(t.WARNING="WARNING",t))(Ps||{}),Ds=(t=>(t.ERROR="ERROR",t.CRITICAL="CRITICAL",t.ALERT="ALERT",t.EMERGENCY="EMERGENCY",t))(Ds||{}),Is=(t=>(t.SUCCESS="success",t.WARNING="warning",t.ERROR="error",t))(Is||{});class Ms{constructor(){ze(this,"listeners",[])}subscribe(t){return this.listeners.push(t),()=>{this.listeners=this.listeners.filter((e=>e!==t))}}notify(t){this.listeners.forEach((e=>e(t)))}}s=new WeakMap;const js=new class extends Ms{constructor(){super(...arguments),Ye(this,s,[])}addLog(t){Ke(this,s).push(t),this.notify(Ke(this,s))}getLogs(){return Ke(this,s)}getLog(t){return Ke(this,s)[t]}getLogsLength(){return Ke(this,s).length}getWarnings(){return Ke(this,s).filter((t=>t.severity===Is.WARNING))}getErrors(){return Ke(this,s).filter((t=>t.severity===Is.ERROR))}clearLogs(){Xe(this,s,[]),this.notify(Ke(this,s))}};class $s{}const Us=class extends $s{constructor(){super(),Ye(this,o),ze(this,"isOnHomePage",!1),ze(this,"mount",(()=>{const t=document.querySelector(".error-page");t?Qe(this,o,c).call(this,t):Ke(this,o,i).addEventListener(Bs.hydrationEventName,Ke(this,d).bind(this),{once:!0})})),ze(this,"beforeDestroy",(()=>{var t;Ke(this,o,i).removeEventListener(Bs.hydrationEventName,Ke(this,d).bind(this)),null==(t=Ke(this,o,l))||t.removeEventListener("submit",Ke(this,h)),js.clearLogs()})),Ye(this,d,(async t=>{t instanceof CustomEvent?Qe(this,o,a).call(this,t):console.debug("Unexpected type of event received.")})),Ye(this,h,(async t=>{t.preventDefault(),await Ls.post(t.target.dataset.routeToSubmit,new FormData(Ke(this,o,u)))})),Ye(this,p,(()=>{const t=document.querySelector(".error-page");Uu.track("[SUE] Error displayed",{error_code:null==t?void 0:t.dataset.errorCode,error_type:null==t?void 0:t.dataset.errorType})})),this.isOnHomePage="home-page"===new URLSearchParams(window.location.search).get("route")}};o=new WeakSet,i=function(){const t=document.getElementById(Us.templateId);if(!t)throw new Error("Error template not found");return["target"].forEach((e=>{if(!t.dataset[e])throw new Error(`Missing data ${e} from element dataset.`)})),t},a=function(t){var e,n,r;const s=Ke(this,o,i).content.cloneNode(!0),a=new Cs(s);a.updateId(t.detail),a.updateLeftColumn(t.detail.code),a.updateDescriptionBlock(t.detail),a.updateResponseBlock(t.detail.additionalContents);const u=document.getElementById(Ke(this,o,i).dataset.target);if(!u)throw new Error("Target element cannot be found");u.replaceChildren(s);let l=null;if(null==(e=t.detail.requestParams)?void 0:e.responseURL){const e=new URLSearchParams(null==(r=new URL(null==(n=t.detail.requestParams)?void 0:n.responseURL))?void 0:r.search);l=null==e?void 0:e.get("route")}js.addLog({severity:Is.ERROR,height:0,offsetTop:0,message:`HTTP request failed. Route ${l??"N/A"} - Type: ${t.detail.type??"N/A"} - HTTP Code ${t.detail.code??"N/A"}`}),Qe(this,o,c).call(this,document.querySelector(".error-page"))},c=function(t){var e;Ke(this,o,u).addEventListener("submit",Ke(this,h),{once:!0}),null==(e=Ke(this,o,l))||e.addEventListener("submit",Ke(this,h));const n=this.isOnHomePage?t.querySelector("#exit-button"):t.querySelector("#home-page-form");n&&n.classList.remove("hidden"),Ke(this,p).call(this)},u=function(){const t=document.forms.namedItem("home-page-form");if(!t)throw new Error("Form not found");return["routeToSubmit"].forEach((e=>{if(!t.dataset[e])throw new Error(`Missing data ${e} from form dataset.`)})),t},l=function(){return document.forms.namedItem("submit-error-report")},d=new WeakMap,h=new WeakMap,p=new WeakMap,ze(Us,"templateId","error-page-template");let Fs=Us;const Ws=class t{constructor(){ze(this,"hydrationEvent",new Event(t.hydrationEventName)),Wu.mount()}hydrate(t,e){const n=document.getElementById(t.parent_to_update);n&&t.new_content&&(t.new_route&&Bu.unloadScriptType(tn.PAGE),n.innerHTML=t.new_content,t.new_route&&(Bu.loadScript(t.new_route),e||Fu.setNewRoute(t.new_route)),t.add_script&&Bu.loadScript(t.add_script),n.dispatchEvent(this.hydrationEvent))}hydrateError(e){Bu.unloadScriptType(tn.PAGE),Bu.loadScript("error-page");const n=document.getElementById(Fs.templateId);null==n||n.dispatchEvent(new CustomEvent(t.hydrationEventName,{detail:e}))}};ze(Ws,"hydrationEventName","hydrate");let Bs=Ws;const qs=class t{constructor(){Ye(this,f)}mount(){this.dialogContainer.addEventListener(Bs.hydrationEventName,Qe(this,f,m)),this.dialogContainer.addEventListener("click",Qe(this,f,g)),this.dialogContainer.addEventListener(t.cancelEvent,Qe(this,f,y)),this.dialogContainer.addEventListener(t.okEvent,Qe(this,f,y))}beforeDestroy(){this.dialogContainer.removeEventListener(Bs.hydrationEventName,Qe(this,f,m)),this.dialogContainer.removeEventListener("click",Qe(this,f,g)),this.dialogContainer.removeEventListener(t.cancelEvent,Qe(this,f,y)),this.dialogContainer.removeEventListener(t.okEvent,Qe(this,f,y))}get dialogContainer(){const e=document.getElementById(t.containerId);if(!e)throw new Error("Cannot find dialog container to initialize.");return e}};f=new WeakSet,m=function(){var t;const e=null==(t=document.getElementById(qs.containerId))?void 0:t.getElementsByClassName("dialog")[0];e&&e.showModal()},g=function(t){const e=t.target?t.target:null,n=null==e?void 0:e.closest(".dialog");n&&(!(null==e?void 0:e.closest("[data-dismiss='dialog']"))&&n.contains(e)&&e!==n||n.dispatchEvent(new Event(qs.cancelEvent,{bubbles:!0})))},y=function(t){Bu.unloadScriptType(tn.DIALOG);const e=t.target;e&&e.close()},ze(qs,"cancelEvent","cancel"),ze(qs,"okEvent","ok"),ze(qs,"containerId","ua_dialog");let Hs=qs;v=new WeakSet,_=function(){return new URL(window.location.href)},b=function(){return Qe(this,v,_).call(this).searchParams},E=async function(){const t=this.getCurrentRoute();null!==t&&await Ls.post(t,new FormData,!0)},w=function(){const t=Qe(this,v,b).call(this);if(t.has("_redirected")){t.delete("_redirected");const e=`${Qe(this,v,_).call(this).pathname}?${t.toString()}`;window.history.replaceState(null,"",e)}};class Gs extends $s{constructor(){if(super(),ze(this,"mount",(()=>{this.form&&(this.checkForm(),this.form.addEventListener("change",this.checkForm),this.form.addEventListener("submit",this.handleSubmit))})),ze(this,"beforeDestroy",(()=>{this.form&&(this.form.removeEventListener("change",this.checkForm),this.form.removeEventListener("submit",this.handleSubmit))})),ze(this,"checkForm",(()=>{var t,e;this.formIsValid?null==(t=this.submitButton)||t.removeAttribute("disabled"):null==(e=this.submitButton)||e.setAttribute("disabled","true")})),ze(this,"handleSubmit",(async t=>{var e,n,r,s,o;t.preventDefault();const i=null==(e=this.form)?void 0:e.dataset.routeToSubmit;if(i){null==(n=this.submitButton)||n.classList.add("btn--loading"),null==(r=this.submitButton)||r.setAttribute("inert","");const t=new FormData(this.form);"update"===t.get("route_choice")&&Uu.track("[SUE] Update initiated"),"restore"===t.get("route_choice")&&Uu.track("[SUE] Restore initiated"),await Ls.post(i,t),null==(s=this.submitButton)||s.classList.remove("btn--loading"),null==(o=this.submitButton)||o.removeAttribute("inert")}})),!this.form)throw new Error("The form wasn't found inside DOM. HomePage can't be initiated properly");if(!this.submitButton)throw new Error("The submit button wasn't found inside DOM. HomePage can't be initiated properly")}get form(){return document.forms.namedItem("next_page")}get formIsValid(){return!!this.form&&this.form.checkValidity()}get submitButton(){return this.form?Array.from(this.form.elements).find((t=>t instanceof HTMLButtonElement&&"submit"===t.type)):void 0}}class Vs{constructor(){Ye(this,L),Ye(this,S,"stepper__step"),Ye(this,k,`${Ke(this,S)}--current`),Ye(this,x,`${Ke(this,S)}--done`),Ye(this,R,`${Ke(this,S)}--normal`),Ye(this,O,"stepper--hydration"),ze(this,"setCurrentStep",(t=>{var e;const n=Ke(this,T).call(this,t);-1!==n?(null==(e=Ke(this,L,C))||e.classList.add(Ke(this,O)),Ke(this,L,N).forEach(((t,e)=>{const{element:r}=t,s=Qe(this,L,A).call(this,n,e);r.classList.contains(s)||(r.classList.remove(Ke(this,k),Ke(this,x),Ke(this,R)),r.classList.add(s))}))):console.debug(`Step ${t} not found in list.`)})),Ye(this,T,(t=>Ke(this,L,N).findIndex((e=>e.code===t))))}}S=new WeakMap,k=new WeakMap,x=new WeakMap,R=new WeakMap,O=new WeakMap,T=new WeakMap,L=new WeakSet,A=function(t,e){return Ke(this,e===t?k:e<t?x:R)},C=function(){const t=document.getElementById(window.AutoUpgradeVariables.stepper_parent_id);if(!t)throw new Error("The stepper wasn't found inside DOM. stepper can't be initiated properly");return t},N=function(){const t=Array.from(Ke(this,L,C).children);if(!t.length)throw new Error("The stepper hasn't steps inside DOM. stepper can't be initiated properly");return t.map((t=>{const e=t.dataset.stepCode;if(!e)throw new Error("Step code is missing in one of the steps. stepper can't be initiated properly");return{code:e,element:t}}))};class zs extends $s{constructor(){super(),ze(this,"stepCode",""),ze(this,"initStepper",(()=>{window.PageStepper?window.PageStepper.setCurrentStep(this.stepCode):window.PageStepper=new Vs}))}mount(){}beforeDestroy(){}}class Js extends zs{constructor(){super(),Ye(this,B),ze(this,"stepCode","version-choice"),ze(this,"radioLoadingClass","radio--show-requirements-loader"),ze(this,"mount",(()=>{var t,e;this.initStepper(),Ke(this,B,q)&&(Ke(this,B,q).addEventListener("change",Ke(this,F).bind(this)),Ke(this,B,q).addEventListener("submit",Ke(this,W)),Ke(this,B,q).dispatchEvent(new Event("change")),null==(t=Ke(this,B,J))||t.addEventListener(Bs.hydrationEventName,Ke(this,j)),null==(e=Ke(this,B,X))||e.addEventListener(Bs.hydrationEventName,Ke(this,j)),Ke(this,U).call(this),Ke(this,D).call(this))})),ze(this,"beforeDestroy",(()=>{var t,e,n,r;Ke(this,B,q)&&(Ke(this,B,q).removeEventListener("change",Ke(this,F)),Ke(this,B,q).removeEventListener("submit",Ke(this,W)),null==(t=Ke(this,B,J))||t.removeEventListener(Bs.hydrationEventName,Ke(this,U)),null==(e=Ke(this,B,X))||e.removeEventListener(Bs.hydrationEventName,Ke(this,U)),null==(n=Ke(this,B,z))||n.forEach((t=>{t.removeEventListener("click",Ke(this,F))})),null==(r=Ke(this,B,V))||r.removeEventListener("click",Ke(this,M)))})),Ye(this,P,(async t=>{const e=new FormData(Ke(this,B,q));await Ls.post(t,e)})),Ye(this,D,(()=>{var t;(null==(t=Ke(this,B,z))?void 0:t.length)&&Ke(this,B,z).forEach((t=>{t.addEventListener("click",Ke(this,F))}))})),Ye(this,I,(()=>{var t;null==(t=Ke(this,B,V))||t.addEventListener("click",Ke(this,M))})),Ye(this,M,(async t=>{const e=t.target;if(!e||"A"!==e.tagName||!e.hash)return;t.preventDefault();const n=e.hash.substring(1);await Ls.post(n)})),Ye(this,j,(()=>{Ke(this,U).call(this),Ke(this,D).call(this),Ke(this,I).call(this)})),Ye(this,U,(()=>{var t,e;Ke(this,B,G)?null==(t=Ke(this,B,H))||t.removeAttribute("disabled"):null==(e=Ke(this,B,H))||e.setAttribute("disabled","true")})),Ye(this,F,(async()=>{var t,e;Ls.abortCurrentPost(),null==(t=Ke(this,B,Q))||t.classList.remove(this.radioLoadingClass),null==(e=Ke(this,B,K))||e.classList.remove(this.radioLoadingClass);const n=Ke(this,B,q).dataset.routeToSave;if(!n)throw new Error("No route to save form provided. Impossible to save form.");let r=null;Ke(this,B,Y)&&(r=Ke(this,B,K)),Ke(this,B,st)&&(r=Ke(this,B,Q)),r&&(r.removeAttribute("data-requirements-are-ok"),Ke(this,U).call(this),r.classList.add(this.radioLoadingClass),await Ke(this,P).call(this,n))})),Ye(this,W,(async t=>{t.preventDefault();const e=Ke(this,B,q).dataset.routeToSubmit;if(!e)throw new Error("No route to submit form provided. Impossible to submit form.");Uu.track("[SUE] Version choice submitted",{upgrade_channel:Ke(this,B,Y)?"online":"local"}),await Ke(this,P).call(this,e)}))}}P=new WeakMap,D=new WeakMap,I=new WeakMap,M=new WeakMap,j=new WeakMap,U=new WeakMap,F=new WeakMap,W=new WeakMap,B=new WeakSet,q=function(){return document.forms.namedItem("version_choice")},H=function(){return Ke(this,B,q)?Array.from(Ke(this,B,q).elements).find((t=>t instanceof HTMLButtonElement&&"submit"===t.type)):void 0},G=function(){return Ke(this,B,Y)?"1"===Ke(this,B,K).dataset.requirementsAreOk:!!Ke(this,B,st)&&"1"===Ke(this,B,Q).dataset.requirementsAreOk},V=function(){var t;return null==(t=Ke(this,B,q))?void 0:t.querySelector('[data-slot-component="requirements"]')},z=function(){return Ke(this,B,q)?Array.from(Ke(this,B,q).elements).filter((t=>t instanceof HTMLButtonElement&&"check-requirements-again"===t.dataset.action)):void 0},J=function(){return document.getElementById("radio_card_online")},K=function(){var t;return null==(t=Ke(this,B,q))?void 0:t.elements.namedItem("online")},Y=function(){return Ke(this,B,K)&&Ke(this,B,K).checked||!1},X=function(){return document.getElementById("radio_card_archive")},Q=function(){var t;return null==(t=Ke(this,B,q))?void 0:t.elements.namedItem("local")},Z=function(){var t;return(null==(t=Ke(this,B,Q))?void 0:t.checked)||!1},tt=function(){var t;return null==(t=Ke(this,B,q))?void 0:t.elements.namedItem("archive_zip")},et=function(){var t;return!!(null==(t=Ke(this,B,tt))?void 0:t.value)},nt=function(){return Ke(this,B,q).elements.namedItem("archive_xml")},rt=function(){return Ke(this,B,nt)&&!!Ke(this,B,nt).value||!1},st=function(){return Ke(this,B,Z)&&Ke(this,B,et)&&Ke(this,B,rt)};class Ks extends zs{constructor(){super(...arguments),Ye(this,ot),ze(this,"stepCode","update-options"),Ye(this,at,(async t=>{const e=t.target,n=new FormData(Ke(this,ot,it));e.setAttribute("disabled","true"),await Ls.post(Ke(this,ot,it).dataset.routeToSave,n),e.removeAttribute("disabled")})),Ye(this,ct,(async t=>{t.preventDefault();const e=new FormData(Ke(this,ot,it));Uu.track("[SUE] Update options configured",{disable_all_overrides:!!e.get("PS_DISABLE_OVERRIDES"),disable_non_native_modules:!!e.get("PS_AUTOUP_CUSTOM_MOD_DESACT"),regenerate_customized_email_templates:!!e.get("PS_AUTOUP_REGEN_EMAIL")}),await Ls.post(Ke(this,ot,it).dataset.routeToSubmit,e)}))}mount(){this.initStepper(),Ke(this,ot,it).addEventListener("submit",Ke(this,ct)),Ke(this,ot,it).addEventListener("change",Ke(this,at))}beforeDestroy(){try{Ke(this,ot,it).removeEventListener("submit",Ke(this,ct)),Ke(this,ot,it).removeEventListener("change",Ke(this,at))}catch{}}}ot=new WeakSet,it=function(){const t=document.forms.namedItem("update-options-page-form");if(!t)throw new Error("Form not found");return["routeToSave","routeToSubmit"].forEach((e=>{if(!t.dataset[e])throw new Error(`Missing data ${e} from form dataset.`)})),t},at=new WeakMap,ct=new WeakMap;class Ys extends zs{constructor(){super(...arguments),Ye(this,ut),ze(this,"stepCode","backup"),Ye(this,ht,(async t=>{const e=t.target,n=new FormData(Ke(this,ut,lt));e.setAttribute("disabled","true"),await Ls.post(Ke(this,ut,lt).dataset.routeToSave,n),e.removeAttribute("disabled")})),Ye(this,pt,(async t=>{t.preventDefault();const e=t.target;await Ls.post(e.dataset.routeToSubmit,new FormData(e))}))}mount(){this.initStepper(),Ke(this,ut,dt).addEventListener("submit",Ke(this,pt)),Ke(this,ut,lt).addEventListener("submit",Ke(this,pt)),Ke(this,ut,lt).addEventListener("change",Ke(this,ht))}beforeDestroy(){Ke(this,ut,dt).removeEventListener("submit",Ke(this,pt)),Ke(this,ut,lt).removeEventListener("submit",Ke(this,pt)),Ke(this,ut,lt).removeEventListener("change",Ke(this,ht))}}ut=new WeakSet,lt=function(){const t=document.forms.namedItem("update-backup-page-form");if(!t)throw new Error("Form not found");return["routeToSave","routeToSubmit"].forEach((e=>{if(!t.dataset[e])throw new Error(`Missing data ${e} from form dataset.`)})),t},dt=function(){const t=document.forms.namedItem("update-backup-page-update-form");if(!t)throw new Error("Form not found");return["routeToSubmit"].forEach((e=>{if(!t.dataset[e])throw new Error(`Missing data ${e} from form dataset.`)})),t},ht=new WeakMap,pt=new WeakMap;class Xs{constructor(t){Ye(this,ft),ze(this,"startProcess",(async t=>{await Ke(this,mt).call(this,t)})),Ye(this,mt,(async t=>{let e=!1,n=t;for(;!1===e;){const t=await Ls.postAction(n);Ke(this,gt).call(this,t),t.next&&!0!==t.error&&"Error"!==t.next||(e=!0),n=t.next}})),Ye(this,gt,(t=>{!0!==t.error&&"Error"!==t.next?(Ke(this,ft).onProcessResponse(t),t.next||Ke(this,ft).onProcessEnd(t)):Ke(this,ft).onError(t)})),Xe(this,ft,t)}}ft=new WeakMap,mt=new WeakMap,gt=new WeakMap;class Qs{constructor(t){Ye(this,yt),ze(this,"queryElement",((t,e)=>{const n=this.element.querySelector(t)??document.querySelector(t);if(!n)throw new Error(e);return n})),Xe(this,yt,t)}get element(){return Ke(this,yt)}}yt=new WeakMap;class Zs extends Qs{constructor(){super(...arguments),Ye(this,_t),Ye(this,vt,this.queryElement('[role="progressbar"]',"Progress bar not found")),ze(this,"beforeDestroy",(()=>{this.element.remove()})),ze(this,"setProgressPercentage",(t=>{const e=Number(t).toString(),n=Ke(this,vt);n.style.width=`${e}%`,n.setAttribute("aria-valuenow",e);const r=n.dataset.titleTemplate;if(r){const t=Qe(this,_t,bt).call(this,r,e);n.title=t,n.setAttribute("aria-label",t)}else console.warn("Title template not found on progress bar")}))}}vt=new WeakMap,_t=new WeakSet,bt=function(t,e){return t.replace("{progress_percentage}",e)};class to extends Qs{constructor(){super(...arguments),Ye(this,Et,this.queryElement('[data-slot-component="text"]',"Logs summary text not found")),ze(this,"beforeDestroy",(()=>{this.element.remove()})),ze(this,"setLogsSummaryText",(t=>{Ke(this,Et).innerText=t}))}}Et=new WeakMap;const eo={...Object.fromEntries(Object.values(Ns).map((t=>[t,Is.SUCCESS]))),...Object.fromEntries(Object.values(Ps).map((t=>[t,Is.WARNING]))),...Object.fromEntries(Object.values(Ds).map((t=>[t,Is.ERROR])))},no=[...Object.values(Ns),...Object.values(Ps),...Object.values(Ds)].join("|");function ro(t){return t.map((t=>t.message)).join("\n").slice(-5e6)}const so=class t extends Qs{constructor(){super(...arguments),Ye(this,Ct),Ye(this,wt,new Map),Ye(this,St,Ke(this,Ct,Nt).clientHeight),Ye(this,kt,!1),Ye(this,xt,"form-logs-download-button"),Ye(this,Rt,this.queryElement("#log-line","Template log line not found")),Ye(this,Ot,this.queryElement('[data-slot-component="summary"]',"Logs summary not found")),Ye(this,Tt,this.queryElement("#log-summary","Template summary not found")),Ye(this,Lt,this.queryElement('[data-slot-component="scroll"]',"Logs scroll not found")),Ye(this,At,this.queryElement("#log-additional-contents","Panel of additional contents not found")),ze(this,"mount",(()=>{Ke(this,Lt).addEventListener("scroll",Ke(this,$t).debounced),setTimeout((()=>{Ke(this,Ct,Nt).style.width=`${Ke(this,Ct,Nt).offsetWidth}px`}),1e3)})),ze(this,"beforeDestroy",(()=>{js.clearLogs(),Ke(this,Lt).removeEventListener("scroll",Ke(this,$t).debounced),Ke(this,Ot).removeEventListener("click",Ke(this,Bt)),Ke(this,$t).cancel()})),ze(this,"addLogs",(e=>{if(Ke(this,kt))return void console.warn("Cannot add logs because summary is displayed");let n=0;e.forEach((e=>{Qe(this,Ct,Pt).call(this,e),n+=1,n>t.CONFIG.LOG_BEFORE_SCROLL&&(Ke(this,It).call(this),n=0)})),Ke(this,It).call(this)})),ze(this,"addError",(t=>{var e,n;const r=document.getElementById(Fs.templateId),s=(null==(e=null==r?void 0:r.content)?void 0:e.querySelector(`.error-page__desc .error-page__desc-${Os(t.code)?t.code:t.type}`))||(null==(n=null==r?void 0:r.content)?void 0:n.querySelector(".error-page__desc-unknown"));s&&this.addLogs([`ERROR - ${s.textContent}`.replace(/\n(\s)*$/gm,"")]),this.addLogs([`ERROR - HTTP request failed. Type: ${t.type??"N/A"} - HTTP Code: ${t.code??"N/A"}`]),t.additionalContents&&(Ke(this,At).innerText=t.additionalContents)})),Ye(this,Dt,((t,e=!1)=>{const n=Ke(this,Rt).content.cloneNode(!0).querySelector(".logs__line");if(n.classList.add(`logs__line--${t.severity}`),n.setAttribute("data-status",t.severity),e&&"offsetTop"in t){n.querySelector(".logs__line-content").textContent=t.message;const e=Qe(this,Ct,Wt).call(this,t.severity).cloneNode(!0);e.href=`#${String(t.offsetTop)}`,n.appendChild(e)}else n.textContent=t.message;return n})),Ye(this,It,(()=>{Ke(this,Lt).scrollTop=Ke(this,St),Ke(this,Mt).call(this)})),Ye(this,Mt,(()=>{const{marginTop:t,marginBottom:e,visibleLogs:n}=Qe(this,Ct,jt).call(this,Ke(this,Lt).scrollTop,Ke(this,Lt).clientHeight);Ke(this,Ct,Nt).style.marginTop=`${t}px`,Ke(this,Ct,Nt).style.marginBottom=`${e}px`,Ke(this,Ct,Nt).innerHTML="",n.forEach((t=>{t.HTMLElement&&Ke(this,Ct,Nt).appendChild(t.HTMLElement)}))})),Ye(this,$t,function(t,e){let n;return{debounced:(...r)=>{n&&clearTimeout(n),n=setTimeout((()=>{t(...r)}),e)},cancel:()=>{n&&(clearTimeout(n),n=void 0)}}}((()=>{Ke(this,Mt).call(this)}),t.CONFIG.DEBOUNCE_TIME)),ze(this,"displaySummary",(async()=>{if(0===js.getLogsLength())return void console.warn("Cannot display summary because logs are empty");const t=document.createDocumentFragment(),e=js.getWarnings();if(e.length>0){const n=Qe(this,Ct,Ut).call(this,Is.WARNING,e);t.appendChild(n)}const n=js.getErrors();if(n.length>0){const e=Qe(this,Ct,Ut).call(this,Is.ERROR,n);t.appendChild(e)}t.hasChildNodes()&&Ke(this,Ot).addEventListener("click",Ke(this,Bt)),Ke(this,Ot).appendChild(t);const r=document.forms.namedItem(Ke(this,xt));if(!r)throw new Error("Form to request the button to download logs cannot be found");await Ls.post(r.dataset.downloadLogsRoute,new FormData(r)),Ke(this,Ot).appendChild(t),Xe(this,kt,!0),Ke(this,It).call(this)})),Ye(this,Bt,(t=>{const e=t.target;if(!e||"A"!==e.tagName||!e.hash)return;t.preventDefault();const n=e.hash.substring(1),r=[...Ke(this,wt).keys()].find((t=>Ke(this,wt).get(t)===Number(n)));if(void 0===r)return;const s=js.getLog(r).HTMLElement;void 0!==s&&(Ke(this,Lt).scrollTop=Number(n),window.setTimeout((()=>{s.classList.add("logs__line--pointed")}),100),window.setTimeout((()=>{s.classList.remove("logs__line--pointed")}),2e3))}))}};wt=new WeakMap,St=new WeakMap,kt=new WeakMap,xt=new WeakMap,Rt=new WeakMap,Ot=new WeakMap,Tt=new WeakMap,Lt=new WeakMap,At=new WeakMap,Ct=new WeakSet,Nt=function(){return this.queryElement('[data-slot-component="list"]',"Logs list not found")},Pt=function(t){const e=js.getLogsLength(),n=function(t){const e=t.trim(),n=new RegExp(`^(${no})\\s*-\\s*(.*)$`,"s").exec(e);if(n){const t=n[1],e=n[2];return{severity:eo[t]||Is.ERROR,message:e}}return{severity:Is.ERROR,message:t}}(t),r=Ke(this,Dt).call(this,n);Ke(this,Ct,Nt).appendChild(r);const s=r.offsetHeight,o=r.offsetTop;return js.addLog({...n,height:s,offsetTop:o,HTMLElement:r}),Ke(this,wt).set(e,o),Xe(this,St,Ke(this,St)+s),e},Dt=new WeakMap,It=new WeakMap,Mt=new WeakMap,jt=function(t,e){const n=t-so.CONFIG.BUFFER_SIZE*e,r=t+e+so.CONFIG.BUFFER_SIZE*e;let s=0,o=0;const i=[];for(const[a,c]of Ke(this,wt).entries()){const t=js.getLogs()[a],e=t.height;c+e<n?s+=e:c>r?o+=e:i.push(t)}return{marginTop:s,marginBottom:o,visibleLogs:i}},$t=new WeakMap,Ut=function(t,e){const n=Ke(this,Tt).content.cloneNode(!0),r=n.querySelector(".logs__summary");r.setAttribute("data-summary-severity",t);const s=n.querySelector(".logs__summary-scroll"),o=Qe(this,Ct,Ft).call(this,t);r.querySelector('[data-slot-template="title"]').textContent=o;return r.querySelector('[data-slot-template="count"]').textContent=String(e.length),e.forEach((t=>{const e=Ke(this,Dt).call(this,t,!0);s.appendChild(e)})),r},Ft=function(t){return this.queryElement(`#summary-${t}-title`,`Summary ${t} title not found`).content.cloneNode(!0).textContent},Wt=function(t){return this.queryElement(`#summary-${t}-link`,`Summary ${t} link not found`).content.cloneNode(!0).querySelector(".link")},Bt=new WeakMap,ze(so,"CONFIG",{BUFFER_SIZE:6,DEBOUNCE_TIME:50,LOG_BEFORE_SCROLL:120});let oo=so;class io extends Qs{constructor(){super(...arguments),Ye(this,Vt),Ye(this,qt,new to(Ke(this,Vt,zt))),Ye(this,Ht,new Zs(Ke(this,Vt,Jt))),Ye(this,Gt,new oo(Ke(this,Vt,Kt))),ze(this,"mount",(()=>{Ke(this,Gt).mount()})),ze(this,"beforeDestroy",(()=>{Ke(this,Gt).beforeDestroy()})),ze(this,"updateProgress",(t=>{var e,n,r;null==(e=Ke(this,qt))||e.setLogsSummaryText(t.next_desc??""),null==(r=Ke(this,Ht))||r.setProgressPercentage((null==(n=t.nextParams)?void 0:n.progressPercentage)||0),Ke(this,Gt).addLogs(t.nextQuickInfo),t.apiError&&Ke(this,Gt).addError(t.apiError)})),ze(this,"endProgress",(()=>{var t,e;null==(t=Ke(this,qt))||t.beforeDestroy(),Xe(this,qt,null),null==(e=Ke(this,Ht))||e.beforeDestroy(),Xe(this,Ht,null),Ke(this,Gt).displaySummary()}))}}qt=new WeakMap,Ht=new WeakMap,Gt=new WeakMap,Vt=new WeakSet,zt=function(){return this.queryElement('[data-component="logs-summary"]',"Logs summary not found")},Jt=function(){return this.queryElement('[data-component="progress-bar"]',"Progress bar not found")},Kt=function(){return this.queryElement('[data-component="logs-viewer"]',"Logs viewer not found")};class ao{constructor(t,e){Ye(this,Xt),Ye(this,Yt,new io(Ke(this,Xt,Qt))),ze(this,"mount",(async()=>{Ke(this,Yt).mount();const t=new Xs({onProcessResponse:Ke(this,Zt),onProcessEnd:Ke(this,te),onError:Ke(this,ee)});Ke(this,se).call(this),await t.startProcess(this.initialAction)})),Ye(this,Zt,(t=>{Ke(this,Yt).updateProgress(t)})),Ye(this,te,(async t=>{Ke(this,oe).call(this),t.error?Ke(this,ee).call(this,t):await Ls.post(Ke(this,Xt,Qt).dataset.successRoute)})),Ye(this,ee,(t=>{Ke(this,oe).call(this),Ke(this,Yt).updateProgress(t),Ke(this,Yt).endProgress(),Ke(this,ne).call(this),Ke(this,re).call(this),this.callbacks.onError()})),Ye(this,ne,(()=>{const t=document.getElementById("error-alert");if(!t)throw new Error("Error alert container not found");t.classList.remove("hidden")})),Ye(this,re,(()=>{const t=document.getElementById("error-buttons");if(!t)throw new Error("Error buttons container not found");t.classList.remove("hidden")})),Ye(this,se,(()=>{window.addEventListener("beforeunload",Ke(this,ie))})),Ye(this,oe,(()=>{window.removeEventListener("beforeunload",Ke(this,ie))})),Ye(this,ie,(t=>{t.preventDefault(),t.returnValue=!0})),this.initialAction=t,this.callbacks=e}beforeDestroy(){Ke(this,Yt).beforeDestroy(),Ke(this,oe).call(this)}}Yt=new WeakMap,Xt=new WeakSet,Qt=function(){const t=document.querySelector('[data-component="progress-tracker"]');if(!t)throw new Error("Progress tracker container not found");return t},Zt=new WeakMap,te=new WeakMap,ee=new WeakMap,ne=new WeakMap,re=new WeakMap,se=new WeakMap,oe=new WeakMap,ie=new WeakMap;class co extends zs{constructor(){super(),ze(this,"stepCode","backup"),Ye(this,ae),Ye(this,ce,null),Ye(this,ue,null),Ye(this,le,null),Ye(this,de,null),ze(this,"mount",(async()=>{this.initStepper(),await Ke(this,ae).mount()})),ze(this,"beforeDestroy",(()=>{var t,e,n,r;Ke(this,ae).beforeDestroy(),null==(t=Ke(this,ce))||t.removeEventListener("submit",Ke(this,pe)),null==(e=Ke(this,ue))||e.removeEventListener("submit",Ke(this,pe)),null==(n=Ke(this,le))||n.removeEventListener("submit",Ke(this,pe)),null==(r=Ke(this,de))||r.removeEventListener("submit",Ke(this,pe))})),Ye(this,he,(()=>{var t,e,n,r;Xe(this,ce,document.forms.namedItem("submit-skip-backup")),null==(t=Ke(this,ce))||t.addEventListener("submit",Ke(this,pe)),Xe(this,ue,document.forms.namedItem("submit-error-report")),null==(e=Ke(this,ue))||e.addEventListener("submit",Ke(this,pe)),Xe(this,de,document.forms.namedItem("retry-alert")),null==(n=Ke(this,de))||n.addEventListener("submit",Ke(this,pe)),Xe(this,le,document.forms.namedItem("retry-button")),null==(r=Ke(this,le))||r.addEventListener("submit",Ke(this,pe))})),Ye(this,pe,(async t=>{t.preventDefault();const e=t.target;await Ls.post(e.dataset.routeToSubmit)}));const t=document.getElementById("ua_step_content").dataset.initialProcessAction;Xe(this,ae,new ao(t,{onError:Ke(this,he)}))}}ae=new WeakMap,ce=new WeakMap,ue=new WeakMap,le=new WeakMap,de=new WeakMap,he=new WeakMap,pe=new WeakMap;class uo extends zs{constructor(){super(),ze(this,"stepCode","update"),Ye(this,fe),Ye(this,me,null),Ye(this,ge,null),Ye(this,ye,null),ze(this,"mount",(()=>{this.initStepper(),Ke(this,fe).mount()})),ze(this,"beforeDestroy",(()=>{var t,e,n;Ke(this,fe).beforeDestroy(),null==(t=Ke(this,me))||t.removeEventListener("submit",Ke(this,_e)),null==(e=Ke(this,ge))||e.removeEventListener("submit",Ke(this,_e)),null==(n=Ke(this,ye))||n.removeEventListener("submit",Ke(this,_e))})),Ye(this,ve,(()=>{var t,e,n;Xe(this,me,document.forms.namedItem("restore-alert")),null==(t=Ke(this,me))||t.addEventListener("submit",Ke(this,_e)),Xe(this,ye,document.forms.namedItem("submit-error-report")),null==(e=Ke(this,ye))||e.addEventListener("submit",Ke(this,_e)),Xe(this,ge,document.forms.namedItem("restore-button")),null==(n=Ke(this,ge))||n.addEventListener("submit",Ke(this,_e))})),Ye(this,_e,(async t=>{t.preventDefault();const e=t.target;await Ls.post(e.dataset.routeToSubmit)}));const t=document.getElementById("ua_step_content").dataset.initialProcessAction;Xe(this,fe,new ao(t,{onError:Ke(this,ve)}))}}fe=new WeakMap,me=new WeakMap,ge=new WeakMap,ye=new WeakMap,ve=new WeakMap,_e=new WeakMap;class lo extends zs{constructor(){super(...arguments),ze(this,"stepCode","post-update")}mount(){this.initStepper()}}class ho extends zs{constructor(){super(),Ye(this,be),ze(this,"stepCode","backup-selection"),ze(this,"mount",(()=>{this.initStepper(),Ke(this,be,Ee).addEventListener("change",Ke(this,we).bind(this)),Ke(this,be,Ee).addEventListener("submit",Ke(this,Se))})),ze(this,"beforeDestroy",(()=>{Ke(this,be,Ee).removeEventListener("change",Ke(this,we).bind(this)),Ke(this,be,Ee).removeEventListener("submit",Ke(this,Se))})),Ye(this,we,(async()=>{const t=Ke(this,be,Ee).dataset.routeToSave;if(!t)throw new Error("No route to save form provided. Impossible to save form.");await Ke(this,ke).call(this,t)})),Ye(this,Se,(async t=>{var e;let n;if(t.preventDefault(),n="delete"===(null==(e=t.submitter)?void 0:e.value)?Ke(this,be,Ee).dataset.routeToSubmitDelete:Ke(this,be,Ee).dataset.routeToSubmitRestore,!n)throw new Error("No route to submit form provided. Impossible to submit form.");await Ke(this,ke).call(this,n)})),Ye(this,ke,(async t=>{const e=new FormData(Ke(this,be,Ee));await Ls.post(t,e)}))}}be=new WeakSet,Ee=function(){return document.forms.namedItem("backup_choice")},we=new WeakMap,Se=new WeakMap,ke=new WeakMap;class po extends zs{constructor(){super(),ze(this,"stepCode","restore"),Ye(this,xe),Ye(this,Re,null),Ye(this,Oe,null),ze(this,"mount",(()=>{this.initStepper(),Ke(this,xe).mount()})),ze(this,"beforeDestroy",(()=>{var t,e;Ke(this,xe).beforeDestroy(),null==(t=Ke(this,Re))||t.removeEventListener("submit",Ke(this,Le)),null==(e=Ke(this,Oe))||e.removeEventListener("submit",Ke(this,Le))})),Ye(this,Te,(()=>{var t,e;Xe(this,Re,document.forms.namedItem("try-again-button")),null==(t=Ke(this,Re))||t.addEventListener("submit",Ke(this,Le)),Xe(this,Oe,document.forms.namedItem("submit-error-report")),null==(e=Ke(this,Oe))||e.addEventListener("submit",Ke(this,Le))})),Ye(this,Le,(async t=>{t.preventDefault();const e=t.target.dataset.routeToSubmit;if(!e)throw new Error("No route to submit form provided. Impossible to submit form.");await Ls.post(e)}));const t=document.getElementById("ua_step_content").dataset.initialProcessAction;Xe(this,xe,new ao(t,{onError:Ke(this,Te)}))}}xe=new WeakMap,Re=new WeakMap,Oe=new WeakMap,Te=new WeakMap,Le=new WeakMap;class fo extends zs{constructor(){super(),ze(this,"stepCode","post-restore")}mount(){this.initStepper()}}class mo{constructor(){ze(this,"mount",(()=>{this.form.addEventListener("submit",this.onSubmit)})),ze(this,"beforeDestroy",(()=>{this.form.removeEventListener("submit",this.onSubmit)})),ze(this,"onSubmit",(async t=>{t.preventDefault();const e=t.target;await Ls.post(e.dataset.routeToSubmit,new FormData(e)),this.dispatchDialogContainerOkEvent(t)})),ze(this,"dispatchDialogContainerOkEvent",(t=>{const e=t.target?t.target:null,n=null==e?void 0:e.closest(".dialog");null==n||n.dispatchEvent(new Event(Hs.okEvent,{bubbles:!0}))}))}}class go extends mo{constructor(){super(...arguments),ze(this,"formId","backup_to_restore")}get form(){const t=document.forms.namedItem(this.formId);if(!t)throw new Error("Form not found");return["routeToSubmit"].forEach((e=>{if(!t.dataset[e])throw new Error(`Missing data ${e} from form dataset.`)})),t}}class yo extends mo{constructor(){super(...arguments),ze(this,"formId","backup_to_delete")}get form(){const t=document.forms.namedItem(this.formId);if(!t)throw new Error("Form not found");return["routeToSubmit"].forEach((e=>{if(!t.dataset[e])throw new Error(`Missing data ${e} from form dataset.`)})),t}}class vo extends mo{constructor(){super(...arguments),Ye(this,Ae),ze(this,"formId","form-confirm-update"),ze(this,"confirmCheckboxId","dialog-start-update-own-backup"),ze(this,"mount",(()=>{this.form.addEventListener("submit",this.onSubmit),this.form.addEventListener("change",Ke(this,Ne)),Qe(this,Ae,Pe).call(this,document.getElementById("dialog-start-update-own-backup"))})),ze(this,"beforeDestroy",(()=>{this.form.removeEventListener("submit",this.onSubmit),this.form.removeEventListener("change",Ke(this,Ne))})),Ye(this,Ne,(async t=>{const e=t.target;e.id===this.confirmCheckboxId&&Qe(this,Ae,Pe).call(this,e)}))}get form(){const t=document.forms.namedItem(this.formId);if(!t)throw new Error("Form not found");return["routeToSubmit"].forEach((e=>{if(!t.dataset[e])throw new Error(`Missing data ${e} from form dataset.`)})),t}}Ae=new WeakSet,Ce=function(){const t=Array.from(this.form.elements).find((t=>t instanceof HTMLButtonElement&&"submit"===t.type));if(!t)throw new Error(`No submit button found for form ${this.form.id}`);return t},Ne=new WeakMap,Pe=function(t){!t||t.checked?Ke(this,Ae,Ce).removeAttribute("disabled"):Ke(this,Ae,Ce).setAttribute("disabled","true")};class _o extends mo{constructor(){super(...arguments),ze(this,"formId","form-confirm-backup"),ze(this,"onSubmit",(async t=>{t.preventDefault();const e=t.target,n=new FormData(document.forms.namedItem("update-backup-page-form"));await Ls.post(e.dataset.routeToSubmit,new FormData(e)),Uu.track("[SUE] Backup configured",{backup_images:!!n.get("PS_AUTOUP_KEEP_IMAGES")}),this.dispatchDialogContainerOkEvent(t)}))}get form(){const t=document.forms.namedItem(this.formId);if(!t)throw new Error("Form not found");return["routeToSubmit"].forEach((e=>{if(!t.dataset[e])throw new Error(`Missing data ${e} from form dataset.`)})),t}}const bo="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Eo="8.41.0",wo=globalThis;function So(t,e,n){const r=n||wo,s=r.__SENTRY__=r.__SENTRY__||{},o=s[Eo]=s[Eo]||{};return o[t]||(o[t]=e())}const ko="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,xo=["debug","info","warn","error","log","assert","trace"],Ro={};function Oo(t){if(!("console"in wo))return t();const e=wo.console,n={},r=Object.keys(Ro);r.forEach((t=>{const r=Ro[t];n[t]=e[t],e[t]=r}));try{return t()}finally{r.forEach((t=>{e[t]=n[t]}))}}const To=So("logger",(function(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return ko?xo.forEach((n=>{e[n]=(...e)=>{t&&Oo((()=>{wo.console[n](`Sentry Logger [${n}]:`,...e)}))}})):xo.forEach((t=>{e[t]=()=>{}})),e})),Lo="?",Ao=/\(error: (.*)\)/,Co=/captureMessage|captureException/;function No(...t){const e=t.sort(((t,e)=>t[0]-e[0])).map((t=>t[1]));return(t,n=0,r=0)=>{const s=[],o=t.split("\n");for(let i=n;i<o.length;i++){const t=o[i];if(t.length>1024)continue;const n=Ao.test(t)?t.replace(Ao,"$1"):t;if(!n.match(/\S*Error: /)){for(const t of e){const e=t(n);if(e){s.push(e);break}}if(s.length>=50+r)break}}return function(t){if(!t.length)return[];const e=Array.from(t);/sentryWrapped/.test(Po(e).function||"")&&e.pop();e.reverse(),Co.test(Po(e).function||"")&&(e.pop(),Co.test(Po(e).function||"")&&e.pop());return e.slice(0,50).map((t=>({...t,filename:t.filename||Po(e).filename,function:t.function||Lo})))}(s.slice(r))}}function Po(t){return t[t.length-1]||{}}const Do="<anonymous>";function Io(t){try{return t&&"function"==typeof t&&t.name||Do}catch(e){return Do}}function Mo(t){const e=t.exception;if(e){const t=[];try{return e.values.forEach((e=>{e.stacktrace.frames&&t.push(...e.stacktrace.frames)})),t}catch(n){return}}}const jo={},$o={};function Uo(t,e){jo[t]=jo[t]||[],jo[t].push(e)}function Fo(t,e){if(!$o[t]){$o[t]=!0;try{e()}catch(n){ko&&To.error(`Error while instrumenting ${t}`,n)}}}function Wo(t,e){const n=t&&jo[t];if(n)for(const s of n)try{s(e)}catch(r){ko&&To.error(`Error while triggering instrumentation handler.\nType: ${t}\nName: ${Io(s)}\nError:`,r)}}let Bo=null;function qo(){Bo=wo.onerror,wo.onerror=function(t,e,n,r,s){return Wo("error",{column:r,error:s,line:n,msg:t,url:e}),!(!Bo||Bo.__SENTRY_LOADER__)&&Bo.apply(this,arguments)},wo.onerror.__SENTRY_INSTRUMENTED__=!0}let Ho=null;function Go(){Ho=wo.onunhandledrejection,wo.onunhandledrejection=function(t){return Wo("unhandledrejection",t),!(Ho&&!Ho.__SENTRY_LOADER__)||Ho.apply(this,arguments)},wo.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function Vo(){return zo(wo),wo}function zo(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Eo,e[Eo]=e[Eo]||{}}const Jo=Object.prototype.toString;function Ko(t){switch(Jo.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return oi(t,Error)}}function Yo(t,e){return Jo.call(t)===`[object ${e}]`}function Xo(t){return Yo(t,"ErrorEvent")}function Qo(t){return Yo(t,"DOMError")}function Zo(t){return Yo(t,"String")}function ti(t){return"object"==typeof t&&null!==t&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function ei(t){return null===t||ti(t)||"object"!=typeof t&&"function"!=typeof t}function ni(t){return Yo(t,"Object")}function ri(t){return"undefined"!=typeof Event&&oi(t,Event)}function si(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function oi(t,e){try{return t instanceof e}catch(n){return!1}}function ii(t){return!("object"!=typeof t||null===t||!t.__isVue&&!t._isVue)}const ai=wo;function ci(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,s=[];let o=0,i=0;const a=" > ",c=a.length;let u;const l=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||80;for(;n&&o++<r&&(u=ui(n,l),!("html"===u||o>1&&i+s.length*c+u.length>=d));)s.push(u),i+=u.length,n=n.parentNode;return s.reverse().join(a)}catch(n){return"<unknown>"}}function ui(t,e){const n=t,r=[];if(!n||!n.tagName)return"";if(ai.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=e&&e.length?e.filter((t=>n.getAttribute(t))).map((t=>[t,n.getAttribute(t)])):null;if(s&&s.length)s.forEach((t=>{r.push(`[${t[0]}="${t[1]}"]`)}));else{n.id&&r.push(`#${n.id}`);const t=n.className;if(t&&Zo(t)){const e=t.split(/\s+/);for(const t of e)r.push(`.${t}`)}}const o=["aria-label","type","name","title","alt"];for(const i of o){const t=n.getAttribute(i);t&&r.push(`[${i}="${t}"]`)}return r.join("")}function li(t,e=0){return"string"!=typeof t||0===e||t.length<=e?t:`${t.slice(0,e)}...`}function di(t,e){if(!Array.isArray(t))return"";const n=[];for(let s=0;s<t.length;s++){const e=t[s];try{ii(e)?n.push("[VueViewModel]"):n.push(String(e))}catch(r){n.push("[value cannot be serialized]")}}return n.join(e)}function hi(t,e,n=!1){return!!Zo(t)&&(Yo(e,"RegExp")?e.test(t):!!Zo(e)&&(n?t===e:t.includes(e)))}function pi(t,e=[],n=!1){return e.some((e=>hi(t,e,n)))}function fi(t,e,n){if(!(e in t))return;const r=t[e],s=n(r);"function"==typeof s&&gi(s,r);try{t[e]=s}catch(o){ko&&To.log(`Failed to replace method "${e}" in object`,t)}}function mi(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch(r){ko&&To.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function gi(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,mi(t,"__sentry_original__",e)}catch(n){}}function yi(t){return t.__sentry_original__}function vi(t){if(Ko(t))return{message:t.message,name:t.name,stack:t.stack,...bi(t)};if(ri(t)){const e={type:t.type,target:_i(t.target),currentTarget:_i(t.currentTarget),...bi(t)};return"undefined"!=typeof CustomEvent&&oi(t,CustomEvent)&&(e.detail=t.detail),e}return t}function _i(t){try{return e=t,"undefined"!=typeof Element&&oi(e,Element)?ci(t):Object.prototype.toString.call(t)}catch(n){return"<unknown>"}var e}function bi(t){if("object"==typeof t&&null!==t){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}return{}}function Ei(t){return wi(t,new Map)}function wi(t,e){if(function(t){if(!ni(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||"Object"===e}catch(e){return!0}}(t)){const n=e.get(t);if(void 0!==n)return n;const r={};e.set(t,r);for(const s of Object.getOwnPropertyNames(t))void 0!==t[s]&&(r[s]=wi(t[s],e));return r}if(Array.isArray(t)){const n=e.get(t);if(void 0!==n)return n;const r=[];return e.set(t,r),t.forEach((t=>{r.push(wi(t,e))})),r}return t}function Si(){return Date.now()/1e3}const ki=function(){const{performance:t}=wo;if(!t||!t.now)return Si;const e=Date.now()-t.now(),n=null==t.timeOrigin?e:t.timeOrigin;return()=>(n+t.now())/1e3}();function xi(){const t=wo,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const t=new Uint8Array(1);return e.getRandomValues(t),t[0]})}catch(r){}return"10000000100040008000100000000000".replace(/[018]/g,(t=>(t^(15&n())>>t/4).toString(16)))}function Ri(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function Oi(t){const{message:e,event_id:n}=t;if(e)return e;const r=Ri(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Ti(t,e,n){const r=t.exception=t.exception||{},s=r.values=r.values||[],o=s[0]=s[0]||{};o.value||(o.value=e||""),o.type||(o.type="Error")}function Li(t,e){const n=Ri(t);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...e},e&&"data"in e){const t={...r&&r.data,...e.data};n.mechanism.data=t}}function Ai(t){if(t&&t.__sentry_captured__)return!0;try{mi(t,"__sentry_captured__",!0)}catch(e){}return!1}var Ci;function Ni(t){return new Di((e=>{e(t)}))}function Pi(t){return new Di(((e,n)=>{n(t)}))}(()=>{const{performance:t}=wo;if(!t||!t.now)return;const e=36e5,n=t.now(),r=Date.now(),s=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,o=s<e,i=t.timing&&t.timing.navigationStart,a="number"==typeof i?Math.abs(i+n-r):e;(o||a<e)&&(s<=a&&t.timeOrigin)})(),function(t){t[t.PENDING=0]="PENDING";t[t.RESOLVED=1]="RESOLVED";t[t.REJECTED=2]="REJECTED"}(Ci||(Ci={}));class Di{constructor(t){Di.prototype.__init.call(this),Di.prototype.__init2.call(this),Di.prototype.__init3.call(this),Di.prototype.__init4.call(this),this._state=Ci.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(e){this._reject(e)}}then(t,e){return new Di(((n,r)=>{this._handlers.push([!1,e=>{if(t)try{n(t(e))}catch(s){r(s)}else n(e)},t=>{if(e)try{n(e(t))}catch(s){r(s)}else r(t)}]),this._executeHandlers()}))}catch(t){return this.then((t=>t),t)}finally(t){return new Di(((e,n)=>{let r,s;return this.then((e=>{s=!1,r=e,t&&t()}),(e=>{s=!0,r=e,t&&t()})).then((()=>{s?n(r):e(r)}))}))}__init(){this._resolve=t=>{this._setResult(Ci.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(Ci.REJECTED,t)}}__init3(){this._setResult=(t,e)=>{this._state===Ci.PENDING&&(si(e)?e.then(this._resolve,this._reject):(this._state=t,this._value=e,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===Ci.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach((t=>{t[0]||(this._state===Ci.RESOLVED&&t[1](this._value),this._state===Ci.REJECTED&&t[2](this._value),t[0]=!0)}))}}}function Ii(t){const e=ki(),n={sid:xi(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return Ei({sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"==typeof t.did||"string"==typeof t.did?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}(n)};return t&&Mi(n,t),n}function Mi(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),t.did||e.did||(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||ki(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:xi()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"==typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"==typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function ji(){return{traceId:xi(),spanId:xi().substring(16)}}function $i(t,e,n=2){if(!e||"object"!=typeof e||n<=0)return e;if(t&&e&&0===Object.keys(e).length)return t;const r={...t};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=$i(r[s],e[s],n-1));return r}const Ui="_sentrySpan";function Fi(t,e){e?mi(t,Ui,e):delete t[Ui]}function Wi(t){return t[Ui]}class Bi{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=ji()}clone(){const t=new Bi;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,Fi(t,Wi(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Mi(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,e){return this._tags={...this._tags,[t]:e},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,e){return null===e?delete this._contexts[t]:this._contexts[t]=e,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const e="function"==typeof t?t(this):t,[n,r]=e instanceof qi?[e.getScopeData(),e.getRequestSession()]:ni(e)?[t,t.requestSession]:[],{tags:s,extra:o,user:i,contexts:a,level:c,fingerprint:u=[],propagationContext:l}=n||{};return this._tags={...this._tags,...s},this._extra={...this._extra,...o},this._contexts={...this._contexts,...a},i&&Object.keys(i).length&&(this._user=i),c&&(this._level=c),u.length&&(this._fingerprint=u),l&&(this._propagationContext=l),r&&(this._requestSession=r),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Fi(this,void 0),this._attachments=[],this._propagationContext=ji(),this._notifyScopeListeners(),this}addBreadcrumb(t,e){const n="number"==typeof e?e:100;if(n<=0)return this;const r={timestamp:Si(),...t},s=this._breadcrumbs;return s.push(r),this._breadcrumbs=s.length>n?s.slice(-n):s,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Wi(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=$i(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,e){const n=e&&e.event_id?e.event_id:xi();if(!this._client)return To.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:r,...e,event_id:n},this),n}captureMessage(t,e,n){const r=n&&n.event_id?n.event_id:xi();if(!this._client)return To.warn("No client configured on scope - will not capture message!"),r;const s=new Error(t);return this._client.captureMessage(t,e,{originalException:t,syntheticException:s,...n,event_id:r},this),r}captureEvent(t,e){const n=e&&e.event_id?e.event_id:xi();return this._client?(this._client.captureEvent(t,{...e,event_id:n},this),n):(To.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}}const qi=Bi;class Hi{constructor(t,e){let n,r;n=t||new qi,r=e||new qi,this._stack=[{scope:n}],this._isolationScope=r}withScope(t){const e=this._pushScope();let n;try{n=t(e)}catch(r){throw this._popScope(),r}return si(n)?n.then((t=>(this._popScope(),t)),(t=>{throw this._popScope(),t})):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function Gi(){const t=zo(Vo());return t.stack=t.stack||new Hi(So("defaultCurrentScope",(()=>new qi)),So("defaultIsolationScope",(()=>new qi)))}function Vi(t){return Gi().withScope(t)}function zi(t,e){const n=Gi();return n.withScope((()=>(n.getStackTop().scope=t,e(t))))}function Ji(t){return Gi().withScope((()=>t(Gi().getIsolationScope())))}function Ki(t){const e=zo(t);return e.acs?e.acs:{withIsolationScope:Ji,withScope:Vi,withSetScope:zi,withSetIsolationScope:(t,e)=>Ji(e),getCurrentScope:()=>Gi().getScope(),getIsolationScope:()=>Gi().getIsolationScope()}}function Yi(){return Ki(Vo()).getCurrentScope()}function Xi(){return Ki(Vo()).getIsolationScope()}function Qi(){return Yi().getClient()}function Zi(t){const e=t.getPropagationContext(),{traceId:n,spanId:r,parentSpanId:s}=e;return Ei({trace_id:n,span_id:r,parent_span_id:s})}function ta(t){const e=t._sentryMetrics;if(!e)return;const n={};for(const[,[r,s]]of e){(n[r]||(n[r]=[])).push(Ei(s))}return n}const ea=/^sentry-/;function na(t){const e=function(t){if(!t||!Zo(t)&&!Array.isArray(t))return;if(Array.isArray(t))return t.reduce(((t,e)=>{const n=ra(e);return Object.entries(n).forEach((([e,n])=>{t[e]=n})),t}),{});return ra(t)}(t);if(!e)return;const n=Object.entries(e).reduce(((t,[e,n])=>{if(e.match(ea)){t[e.slice(7)]=n}return t}),{});return Object.keys(n).length>0?n:void 0}function ra(t){return t.split(",").map((t=>t.split("=").map((t=>decodeURIComponent(t.trim()))))).reduce(((t,[e,n])=>(e&&n&&(t[e]=n),t)),{})}let sa=!1;function oa(t){const{spanId:e,traceId:n}=t.spanContext(),{parent_span_id:r}=ca(t);return Ei({parent_span_id:r,span_id:e,trace_id:n})}function ia(t){return"number"==typeof t?aa(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?aa(t.getTime()):ki()}function aa(t){return t>9999999999?t/1e3:t}function ca(t){if(function(t){return"function"==typeof t.getSpanJSON}(t))return t.getSpanJSON();try{const{spanId:e,traceId:n}=t.spanContext();if(function(t){const e=t;return!!(e.attributes&&e.startTime&&e.name&&e.endTime&&e.status)}(t)){const{attributes:r,startTime:s,name:o,endTime:i,parentSpanId:a,status:c}=t;return Ei({span_id:e,trace_id:n,data:r,description:o,parent_span_id:a,start_timestamp:ia(s),timestamp:ia(i)||void 0,status:ua(c),op:r["sentry.op"],origin:r["sentry.origin"],_metrics_summary:ta(t)})}return{span_id:e,trace_id:n}}catch(e){return{}}}function ua(t){if(t&&0!==t.code)return 1===t.code?"ok":t.message||"unknown_error"}function la(t){return t._sentryRootSpan||t}function da(){sa||(Oo((()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")})),sa=!0)}const ha="production";function pa(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},s=Ei({environment:n.environment||ha,release:n.release,public_key:r,trace_id:t});return e.emit("createDsc",s),s}function fa(t){const e=Qi();if(!e)return{};const n=la(t),r=n._frozenDsc;if(r)return r;const s=n.spanContext().traceState,o=s&&s.get("sentry.dsc"),i=o&&na(o);if(i)return i;const a=pa(t.spanContext().traceId,e),c=ca(n),u=c.data||{},l=u["sentry.sample_rate"];null!=l&&(a.sample_rate=`${l}`);const d=u["sentry.source"],h=c.description;return"url"!==d&&h&&(a.transaction=h),function(){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=Qi(),e=t&&t.getOptions();return!!e&&(e.enableTracing||"tracesSampleRate"in e||"tracesSampler"in e)}()&&(a.sampled=String(function(t){const{traceFlags:e}=t.spanContext();return 1===e}(n))),e.emit("createDsc",a,n),a}const ma=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function ga(t,e=!1){const{host:n,path:r,pass:s,port:o,projectId:i,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${o?`:${o}`:""}/${r?`${r}/`:r}${i}`}function ya(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function va(t){const e="string"==typeof t?function(t){const e=ma.exec(t);if(!e)return void Oo((()=>{console.error(`Invalid Sentry Dsn: ${t}`)}));const[n,r,s="",o="",i="",a=""]=e.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const t=u.match(/^\d+/);t&&(u=t[0])}return ya({host:o,pass:s,path:c,projectId:u,port:i,protocol:n,publicKey:r})}(t):ya(t);if(e&&function(t){if(!ko)return!0;const{port:e,projectId:n,protocol:r}=t;return!(["protocol","publicKey","host","projectId"].find((e=>!t[e]&&(To.error(`Invalid Sentry Dsn: ${e} missing`),!0)))||(n.match(/^\d+$/)?function(t){return"http"===t||"https"===t}(r)?e&&isNaN(parseInt(e,10))&&(To.error(`Invalid Sentry Dsn: Invalid port ${e}`),1):(To.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(To.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(e))return e}function _a(t,e=100,n=1/0){try{return Ea("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function ba(t,e=3,n=102400){const r=_a(t,e);return s=r,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(s))>n?ba(t,e-1,n):r;var s}function Ea(t,e,n=1/0,r=1/0,s=function(){const t="function"==typeof WeakSet,e=t?new WeakSet:[];return[function(n){if(t)return!!e.has(n)||(e.add(n),!1);for(let t=0;t<e.length;t++)if(e[t]===n)return!0;return e.push(n),!1},function(n){if(t)e.delete(n);else for(let t=0;t<e.length;t++)if(e[t]===n){e.splice(t,1);break}}]}()){const[o,i]=s;if(null==e||["boolean","string"].includes(typeof e)||"number"==typeof e&&Number.isFinite(e))return e;const a=function(t,e){try{if("domain"===t&&e&&"object"==typeof e&&e._events)return"[Domain]";if("domainEmitter"===t)return"[DomainEmitter]";if("undefined"!=typeof global&&e===global)return"[Global]";if("undefined"!=typeof window&&e===window)return"[Window]";if("undefined"!=typeof document&&e===document)return"[Document]";if(ii(e))return"[VueViewModel]";if(ni(n=e)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n)return"[SyntheticEvent]";if("number"==typeof e&&!Number.isFinite(e))return`[${e}]`;if("function"==typeof e)return`[Function: ${Io(e)}]`;if("symbol"==typeof e)return`[${String(e)}]`;if("bigint"==typeof e)return`[BigInt: ${String(e)}]`;const r=function(t){const e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}(e);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}var n}(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;const c="number"==typeof e.__sentry_override_normalization_depth__?e.__sentry_override_normalization_depth__:n;if(0===c)return a.replace("object ","");if(o(e))return"[Circular ~]";const u=e;if(u&&"function"==typeof u.toJSON)try{return Ea("",u.toJSON(),c-1,r,s)}catch(p){}const l=Array.isArray(e)?[]:{};let d=0;const h=vi(e);for(const f in h){if(!Object.prototype.hasOwnProperty.call(h,f))continue;if(d>=r){l[f]="[MaxProperties ~]";break}const t=h[f];l[f]=Ea(f,t,c-1,r,s),d++}return i(e),l}function wa(t,e=[]){return[t,e]}function Sa(t,e){const[n,r]=t;return[n,[...r,e]]}function ka(t,e){const n=t[1];for(const r of n){if(e(r,r[0].type))return!0}return!1}function xa(t){return wo.__SENTRY__&&wo.__SENTRY__.encodePolyfill?wo.__SENTRY__.encodePolyfill(t):(new TextEncoder).encode(t)}function Ra(t){const[e,n]=t;let r=JSON.stringify(e);function s(t){"string"==typeof r?r="string"==typeof t?r+t:[xa(r),t]:r.push("string"==typeof t?xa(t):t)}for(const i of n){const[t,e]=i;if(s(`\n${JSON.stringify(t)}\n`),"string"==typeof e||e instanceof Uint8Array)s(e);else{let t;try{t=JSON.stringify(e)}catch(o){t=JSON.stringify(_a(e))}s(t)}}return"string"==typeof r?r:function(t){const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}(r)}function Oa(t){const e="string"==typeof t.data?xa(t.data):t.data;return[Ei({type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),e]}const Ta={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function La(t){return Ta[t]}function Aa(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function Ca(t,e,n,r){const s=Aa(n),o=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,e){e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]])}(t,n&&n.sdk);const i=function(t,e,n,r){const s=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:ga(r)},...s&&{trace:Ei({...s})}}}(t,s,r,e);delete t.sdkProcessingMetadata;return wa(i,[[{type:o},t]])}function Na(t,e,n,r=0){return new Di(((s,o)=>{const i=t[r];if(null===e||"function"!=typeof i)s(e);else{const a=i({...e},n);bo&&i.id&&null===a&&To.log(`Event processor "${i.id}" dropped event`),si(a)?a.then((e=>Na(t,e,n,r+1).then(s))).then(null,o):Na(t,a,n,r+1).then(s).then(null,o)}}))}let Pa,Da,Ia;function Ma(t,e){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:o}=e;!function(t,e){const{extra:n,tags:r,user:s,contexts:o,level:i,transactionName:a}=e,c=Ei(n);c&&Object.keys(c).length&&(t.extra={...c,...t.extra});const u=Ei(r);u&&Object.keys(u).length&&(t.tags={...u,...t.tags});const l=Ei(s);l&&Object.keys(l).length&&(t.user={...l,...t.user});const d=Ei(o);d&&Object.keys(d).length&&(t.contexts={...d,...t.contexts});i&&(t.level=i);a&&"transaction"!==t.type&&(t.transaction=a)}(t,e),r&&function(t,e){t.contexts={trace:oa(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:fa(e),...t.sdkProcessingMetadata};const n=la(e),r=ca(n).description;r&&!t.transaction&&"transaction"===t.type&&(t.transaction=r)}(t,r),function(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e));t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}(t,n),function(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}(t,s),function(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}(t,o)}function ja(t,e){const{extra:n,tags:r,user:s,contexts:o,level:i,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:u,eventProcessors:l,attachments:d,propagationContext:h,transactionName:p,span:f}=e;$a(t,"extra",n),$a(t,"tags",r),$a(t,"user",s),$a(t,"contexts",o),t.sdkProcessingMetadata=$i(t.sdkProcessingMetadata,a,2),i&&(t.level=i),p&&(t.transactionName=p),f&&(t.span=f),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),u.length&&(t.fingerprint=[...t.fingerprint,...u]),l.length&&(t.eventProcessors=[...t.eventProcessors,...l]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,...h}}function $a(t,e,n){t[e]=$i(t[e],n,1)}function Ua(t,e,n,r,s,o){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=t,c={...e,event_id:e.event_id||n.event_id||xi(),timestamp:e.timestamp||Si()},u=n.integrations||t.integrations.map((t=>t.name));!function(t,e){const{environment:n,release:r,dist:s,maxValueLength:o=250}=e;t.environment=t.environment||n||ha,!t.release&&r&&(t.release=r);!t.dist&&s&&(t.dist=s);t.message&&(t.message=li(t.message,o));const i=t.exception&&t.exception.values&&t.exception.values[0];i&&i.value&&(i.value=li(i.value,o));const a=t.request;a&&a.url&&(a.url=li(a.url,o))}(c,t),function(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}(c,u),s&&s.emit("applyFrameMetadata",e),void 0===e.type&&function(t,e){const n=function(t){const e=wo._sentryDebugIds;if(!e)return{};const n=Object.keys(e);return Ia&&n.length===Da||(Da=n.length,Ia=n.reduce(((n,r)=>{Pa||(Pa={});const s=Pa[r];if(s)n[s[0]]=s[1];else{const s=t(r);for(let t=s.length-1;t>=0;t--){const o=s[t],i=o&&o.filename,a=e[r];if(i&&a){n[i]=a,Pa[r]=[i,a];break}}}return n}),{})),Ia}(e);try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{n&&t.filename&&(t.debug_id=n[t.filename])}))}))}catch(r){}}(c,t.stackParser);const l=function(t,e){if(!e)return t;const n=t?t.clone():new qi;return n.update(e),n}(r,n.captureContext);n.mechanism&&Li(c,n.mechanism);const d=s?s.getEventProcessors():[],h=So("globalScope",(()=>new qi)).getScopeData();if(o){ja(h,o.getScopeData())}if(l){ja(h,l.getScopeData())}const p=[...n.attachments||[],...h.attachments];p.length&&(n.attachments=p),Ma(c,h);return Na([...d,...h.eventProcessors],c,n).then((t=>(t&&function(t){const e={};try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.debug_id&&(t.abs_path?e[t.abs_path]=t.debug_id:t.filename&&(e[t.filename]=t.debug_id),delete t.debug_id)}))}))}catch(r){}if(0===Object.keys(e).length)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.entries(e).forEach((([t,e])=>{n.push({type:"sourcemap",code_file:t,debug_id:e})}))}(t),"number"==typeof i&&i>0?function(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((t=>({...t,...t.data&&{data:_a(t.data,e,n)}})))},...t.user&&{user:_a(t.user,e,n)},...t.contexts&&{contexts:_a(t.contexts,e,n)},...t.extra&&{extra:_a(t.extra,e,n)}};t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=_a(t.contexts.trace.data,e,n)));t.spans&&(r.spans=t.spans.map((t=>({...t,...t.data&&{data:_a(t.data,e,n)}}))));return r}(t,i,a):t)))}function Fa(t,e){return Yi().captureEvent(t,e)}function Wa(t){const e=Qi(),n=Xi(),r=Yi(),{release:s,environment:o=ha}=e&&e.getOptions()||{},{userAgent:i}=wo.navigator||{},a=Ii({release:s,environment:o,user:r.getUser()||n.getUser(),...i&&{userAgent:i},...t}),c=n.getSession();return c&&"ok"===c.status&&Mi(c,{status:"exited"}),Ba(),n.setSession(a),r.setSession(a),a}function Ba(){const t=Xi(),e=Yi(),n=e.getSession()||t.getSession();n&&function(t){let e={};"ok"===t.status&&(e={status:"exited"}),Mi(t,e)}(n),qa(),t.setSession(),e.setSession()}function qa(){const t=Xi(),e=Yi(),n=Qi(),r=e.getSession()||t.getSession();r&&n&&n.captureSession(r)}function Ha(t=!1){t?Ba():qa()}function Ga(t,e,n){return e||`${function(t){return`${function(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}(t)}${t.projectId}/envelope/`}(t)}?${function(t,e){const n={sentry_version:"7"};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}(t,n)}`}const Va=[];function za(t){const e=t.defaultIntegrations||[],n=t.integrations;let r;if(e.forEach((t=>{t.isDefaultInstance=!0})),Array.isArray(n))r=[...e,...n];else if("function"==typeof n){const t=n(e);r=Array.isArray(t)?t:[t]}else r=e;const s=function(t){const e={};return t.forEach((t=>{const{name:n}=t,r=e[n];r&&!r.isDefaultInstance&&t.isDefaultInstance||(e[n]=t)})),Object.values(e)}(r),o=s.findIndex((t=>"Debug"===t.name));if(o>-1){const[t]=s.splice(o,1);s.push(t)}return s}function Ja(t,e){for(const n of e)n&&n.afterAllSetup&&n.afterAllSetup(t)}function Ka(t,e,n){if(n[e.name])bo&&To.log(`Integration skipped because it was already installed: ${e.name}`);else{if(n[e.name]=e,-1===Va.indexOf(e.name)&&"function"==typeof e.setupOnce&&(e.setupOnce(),Va.push(e.name)),e.setup&&"function"==typeof e.setup&&e.setup(t),"function"==typeof e.preprocessEvent){const n=e.preprocessEvent.bind(e);t.on("preprocessEvent",((e,r)=>n(e,r,t)))}if("function"==typeof e.processEvent){const n=e.processEvent.bind(e),r=Object.assign(((e,r)=>n(e,r,t)),{id:e.name});t.addEventProcessor(r)}bo&&To.log(`Integration installed: ${e.name}`)}}class Ya extends Error{constructor(t,e="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=e}}const Xa="Not capturing exception because it's already been captured.";class Qa{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=va(t.dsn):bo&&To.warn("No DSN provided, client will not send events."),this._dsn){const e=Ga(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:e})}const e=["enableTracing","tracesSampleRate","tracesSampler"].find((e=>e in t&&null==t[e]));e&&Oo((()=>{console.warn(`[Sentry] Deprecation warning: \`${e}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)}))}captureException(t,e,n){const r=xi();if(Ai(t))return bo&&To.log(Xa),r;const s={event_id:r,...e};return this._process(this.eventFromException(t,s).then((t=>this._captureEvent(t,s,n)))),s.event_id}captureMessage(t,e,n,r){const s={event_id:xi(),...n},o=ti(t)?t:String(t),i=ei(t)?this.eventFromMessage(o,e,s):this.eventFromException(t,s);return this._process(i.then((t=>this._captureEvent(t,s,r)))),s.event_id}captureEvent(t,e,n){const r=xi();if(e&&e.originalException&&Ai(e.originalException))return bo&&To.log(Xa),r;const s={event_id:r,...e},o=(t.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(t,s,o||n)),s.event_id}captureSession(t){"string"!=typeof t.release?bo&&To.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),Mi(t,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const e=this._transport;return e?(this.emit("flush"),this._isClientDoneProcessing(t).then((n=>e.flush(t).then((t=>n&&t))))):Ni(!0)}close(t){return this.flush(t).then((t=>(this.getOptions().enabled=!1,this.emit("close"),t)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some((({name:t})=>t.startsWith("Spotlight"))))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const e=this._integrations[t.name];Ka(this,t,this._integrations),e||Ja(this,[t])}sendEvent(t,e={}){this.emit("beforeSendEvent",t,e);let n=Ca(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of e.attachments||[])n=Sa(n,Oa(s));const r=this.sendEnvelope(n);r&&r.then((e=>this.emit("afterSendEvent",t,e)),null)}sendSession(t){const e=function(t,e,n,r){const s=Aa(n);return wa({sent_at:(new Date).toISOString(),...s&&{sdk:s},...!!r&&e&&{dsn:ga(e)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(e)}recordDroppedEvent(t,e,n){if(this._options.sendClientReports){const r="number"==typeof n?n:1,s=`${t}:${e}`;bo&&To.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(t,e){const n=this._hooks[t]=this._hooks[t]||[];return n.push(e),()=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)}}emit(t,...e){const n=this._hooks[t];n&&n.forEach((t=>t(...e)))}sendEnvelope(t){return this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport?this._transport.send(t).then(null,(t=>(bo&&To.error("Error while sending envelope:",t),t))):(bo&&To.error("Transport disabled"),Ni({}))}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=function(t,e){const n={};return e.forEach((e=>{e&&Ka(t,e,n)})),n}(this,t),Ja(this,t)}_updateSessionFromEvent(t,e){let n=!1,r=!1;const s=e.exception&&e.exception.values;if(s){r=!0;for(const t of s){const e=t.mechanism;if(e&&!1===e.handled){n=!0;break}}}const o="ok"===t.status;(o&&0===t.errors||o&&n)&&(Mi(t,{...n&&{status:"crashed"},errors:t.errors||Number(r||n)}),this.captureSession(t))}_isClientDoneProcessing(t){return new Di((e=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),e(!0)):(n+=1,t&&n>=t&&(clearInterval(r),e(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(t,e,n=Yi(),r=Xi()){const s=this.getOptions(),o=Object.keys(this._integrations);return!e.integrations&&o.length>0&&(e.integrations=o),this.emit("preprocessEvent",t,e),t.type||r.setLastEventId(t.event_id||e.event_id),Ua(s,t,e,n,this,r).then((t=>{if(null===t)return t;t.contexts={trace:Zi(n),...t.contexts};const e=function(t,e){const n=e.getPropagationContext();return n.dsc||pa(n.traceId,t)}(this,n);return t.sdkProcessingMetadata={dynamicSamplingContext:e,...t.sdkProcessingMetadata},t}))}_captureEvent(t,e={},n){return this._processEvent(t,e,n).then((t=>t.event_id),(t=>{if(bo){const e=t;"log"===e.logLevel?To.log(e.message):To.warn(e)}}))}_processEvent(t,e,n){const r=this.getOptions(),{sampleRate:s}=r,o=tc(t),i=Za(t),a=t.type||"error",c=`before send for type \`${a}\``,u=void 0===s?void 0:function(t){if("boolean"==typeof t)return Number(t);const e="string"==typeof t?parseFloat(t):t;if(!("number"!=typeof e||isNaN(e)||e<0||e>1))return e;bo&&To.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`)}(s);if(i&&"number"==typeof u&&Math.random()>u)return this.recordDroppedEvent("sample_rate","error",t),Pi(new Ya(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const l="replay_event"===a?"replay":a,d=(t.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(t,e,n,d).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",l,t),new Ya("An event processor returned `null`, will not send event.","log");if(e.data&&!0===e.data.__sentry__)return n;const s=function(t,e,n,r){const{beforeSend:s,beforeSendTransaction:o,beforeSendSpan:i}=e;if(Za(n)&&s)return s(n,r);if(tc(n)){if(n.spans&&i){const e=[];for(const r of n.spans){const n=i(r);n?e.push(n):(da(),t.recordDroppedEvent("before_send","span"))}n.spans=e}if(o){if(n.spans){const t=n.spans.length;n.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:t}}return o(n,r)}}return n}(this,r,n,e);return function(t,e){const n=`${e} must return \`null\` or a valid event.`;if(si(t))return t.then((t=>{if(!ni(t)&&null!==t)throw new Ya(n);return t}),(t=>{throw new Ya(`${e} rejected with ${t}`)}));if(!ni(t)&&null!==t)throw new Ya(n);return t}(s,c)})).then((r=>{if(null===r){if(this.recordDroppedEvent("before_send",l,t),o){const e=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",e)}throw new Ya(`${c} returned \`null\`, will not send event.`,"log")}const s=n&&n.getSession();if(!o&&s&&this._updateSessionFromEvent(s,r),o){const t=(r.sdkProcessingMetadata&&r.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(r.spans?r.spans.length:0);t>0&&this.recordDroppedEvent("before_send","span",t)}const i=r.transaction_info;if(o&&i&&r.transaction!==t.transaction){const t="custom";r.transaction_info={...i,source:t}}return this.sendEvent(r,e),r})).then(null,(t=>{if(t instanceof Ya)throw t;throw this.captureException(t,{data:{__sentry__:!0},originalException:t}),new Ya(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${t}`)}))}_process(t){this._numProcessing++,t.then((t=>(this._numProcessing--,t)),(t=>(this._numProcessing--,t)))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map((([t,e])=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e}}))}_flushOutcomes(){bo&&To.log("Flushing outcomes...");const t=this._clearOutcomes();if(0===t.length)return void(bo&&To.log("No outcomes to send"));if(!this._dsn)return void(bo&&To.log("No dsn provided, will not send outcomes"));bo&&To.log("Sending outcomes:",t);const e=(n=t,wa((r=this._options.tunnel&&ga(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:Si(),discarded_events:n}]]));var n,r;this.sendEnvelope(e)}}function Za(t){return void 0===t.type}function tc(t){return"transaction"===t.type}function ec(t,e){!0===e.debug&&(bo?To.enable():Oo((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));Yi().update(e.initialScope);const n=new t(e);return function(t){Yi().setClient(t)}(n),n.init(),n}function nc(t){const e=[];function n(t){return e.splice(e.indexOf(t),1)[0]||Promise.resolve(void 0)}return{$:e,add:function(r){if(!(void 0===t||e.length<t))return Pi(new Ya("Not adding Promise because buffer limit was reached."));const s=r();return-1===e.indexOf(s)&&e.push(s),s.then((()=>n(s))).then(null,(()=>n(s).then(null,(()=>{})))),s},drain:function(t){return new Di(((n,r)=>{let s=e.length;if(!s)return n(!0);const o=setTimeout((()=>{t&&t>0&&n(!1)}),t);e.forEach((t=>{Ni(t).then((()=>{--s||(clearTimeout(o),n(!0))}),r)}))}))}}}function rc(t,{statusCode:e,headers:n},r=Date.now()){const s={...t},o=n&&n["x-sentry-rate-limits"],i=n&&n["retry-after"];if(o)for(const a of o.trim().split(",")){const[t,e,,,n]=a.split(":",5),o=parseInt(t,10),i=1e3*(isNaN(o)?60:o);if(e)for(const a of e.split(";"))"metric_bucket"===a&&n&&!n.split(";").includes("custom")||(s[a]=r+i);else s.all=r+i}else i?s.all=r+function(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${t}`);return isNaN(r)?6e4:r-e}(i,r):429===e&&(s.all=r+6e4);return s}function sc(t,e,n=nc(t.bufferSize||64)){let r={};return{send:function(s){const o=[];if(ka(s,((e,n)=>{const s=La(n);if(function(t,e,n=Date.now()){return function(t,e){return t[e]||t.all||0}(t,e)>n}(r,s)){const r=oc(e,n);t.recordDroppedEvent("ratelimit_backoff",s,r)}else o.push(e)})),0===o.length)return Ni({});const i=wa(s[0],o),a=e=>{ka(i,((n,r)=>{const s=oc(n,r);t.recordDroppedEvent(e,La(r),s)}))};return n.add((()=>e({body:Ra(i)}).then((t=>(void 0!==t.statusCode&&(t.statusCode<200||t.statusCode>=300)&&bo&&To.warn(`Sentry responded with status code ${t.statusCode} to sent event.`),r=rc(r,t),t)),(t=>{throw a("network_error"),t})))).then((t=>t),(t=>{if(t instanceof Ya)return bo&&To.error("Skipped sending event because buffer is full."),a("queue_overflow"),Ni({});throw t}))},flush:t=>n.drain(t)}}function oc(t,e){if("event"===e||"transaction"===e)return Array.isArray(t)?t[1]:void 0}const ic=100;function ac(t,e){const n=Qi(),r=Xi();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=ic}=n.getOptions();if(o<=0)return;const i={timestamp:Si(),...t},a=s?Oo((()=>s(i,e))):i;null!==a&&(n.emit&&n.emit("beforeAddBreadcrumb",a,e),r.addBreadcrumb(a,o))}let cc;const uc=new WeakMap,lc=()=>({name:"FunctionToString",setupOnce(){cc=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=yi(this),n=uc.has(Qi())&&void 0!==e?e:this;return cc.apply(n,t)}}catch(t){}},setup(t){uc.set(t,!0)}}),dc=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",'can\'t redefine non-configurable property "solana"',"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler"],hc=(t={})=>({name:"InboundFilters",processEvent(e,n,r){const s=r.getOptions(),o=function(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:dc],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]],ignoreInternal:void 0===t.ignoreInternal||t.ignoreInternal}}(t,s);return function(t,e){if(e.ignoreInternal&&function(t){try{return"SentryError"===t.exception.values[0].type}catch(e){}return!1}(t))return bo&&To.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Oi(t)}`),!0;if(function(t,e){if(t.type||!e||!e.length)return!1;return function(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch(r){}n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`));return e}(t).some((t=>pi(t,e)))}(t,e.ignoreErrors))return bo&&To.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Oi(t)}`),!0;if(function(t){if(t.type)return!1;if(!t.exception||!t.exception.values||0===t.exception.values.length)return!1;return!t.message&&!t.exception.values.some((t=>t.stacktrace||t.type&&"Error"!==t.type||t.value))}(t))return bo&&To.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${Oi(t)}`),!0;if(function(t,e){if("transaction"!==t.type||!e||!e.length)return!1;const n=t.transaction;return!!n&&pi(n,e)}(t,e.ignoreTransactions))return bo&&To.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Oi(t)}`),!0;if(function(t,e){if(!e||!e.length)return!1;const n=pc(t);return!!n&&pi(n,e)}(t,e.denyUrls))return bo&&To.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Oi(t)}.\nUrl: ${pc(t)}`),!0;if(!function(t,e){if(!e||!e.length)return!0;const n=pc(t);return!n||pi(n,e)}(t,e.allowUrls))return bo&&To.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Oi(t)}.\nUrl: ${pc(t)}`),!0;return!1}(e,o)?null:e}});function pc(t){try{let n;try{n=t.exception.values[0].stacktrace.frames}catch(e){}return n?function(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch(n){return bo&&To.error(`Cannot extract url for event ${Oi(t)}`),null}}function fc(t,e,n=250,r,s,o,i){if(!(o.exception&&o.exception.values&&i&&oi(i.originalException,Error)))return;const a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;var c,u;a&&(o.exception.values=(c=mc(t,e,s,i.originalException,r,o.exception.values,a,0),u=n,c.map((t=>(t.value&&(t.value=li(t.value,u)),t)))))}function mc(t,e,n,r,s,o,i,a){if(o.length>=n+1)return o;let c=[...o];if(oi(r[s],Error)){gc(i,a);const o=t(e,r[s]),u=c.length;yc(o,s,u,a),c=mc(t,e,n,r[s],s,[o,...c],o,u)}return Array.isArray(r.errors)&&r.errors.forEach(((r,o)=>{if(oi(r,Error)){gc(i,a);const u=t(e,r),l=c.length;yc(u,`errors[${o}]`,l,a),c=mc(t,e,n,r,s,[u,...c],u,l)}})),c}function gc(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,..."AggregateError"===t.type&&{is_exception_group:!0},exception_id:e}}function yc(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function vc(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function _c(){"console"in wo&&xo.forEach((function(t){t in wo.console&&fi(wo.console,t,(function(e){return Ro[t]=e,function(...e){Wo("console",{args:e,level:t});const n=Ro[t];n&&n.apply(wo.console,e)}}))}))}function bc(t){return"warn"===t?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}const Ec=()=>{let t;return{name:"Dedupe",processEvent(e){if(e.type)return e;try{if(function(t,e){if(!e)return!1;if(function(t,e){const n=t.message,r=e.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!Sc(t,e))return!1;if(!wc(t,e))return!1;return!0}(t,e))return!0;if(function(t,e){const n=kc(e),r=kc(t);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!Sc(t,e))return!1;if(!wc(t,e))return!1;return!0}(t,e))return!0;return!1}(e,t))return bo&&To.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(n){}return t=e}}};function wc(t,e){let n=Mo(t),r=Mo(e);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++){const t=r[s],e=n[s];if(t.filename!==e.filename||t.lineno!==e.lineno||t.colno!==e.colno||t.function!==e.function)return!1}return!0}function Sc(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(s){return!1}}function kc(t){return t.exception&&t.exception.values&&t.exception.values[0]}function xc(t){return void 0===t?void 0:t>=400&&t<500?"warning":t>=500?"error":void 0}const Rc=wo;function Oc(){if(!("fetch"in Rc))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(t){return!1}}function Tc(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Lc(t,e){const n="fetch";Uo(n,t),Fo(n,(()=>function(t,e=!1){if(e&&!function(){if("string"==typeof EdgeRuntime)return!0;if(!Oc())return!1;if(Tc(Rc.fetch))return!0;let t=!1;const e=Rc.document;if(e&&"function"==typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=Tc(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){ko&&To.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}())return;fi(wo,"fetch",(function(t){return function(...e){const{method:n,url:r}=function(t){if(0===t.length)return{method:"GET",url:""};if(2===t.length){const[e,n]=t;return{url:Cc(e),method:Ac(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:Cc(e),method:Ac(e,"method")?String(e.method).toUpperCase():"GET"}}(e),s={args:e,fetchData:{method:n,url:r},startTimestamp:1e3*ki()};Wo("fetch",{...s});const o=(new Error).stack;return t.apply(wo,e).then((async t=>(Wo("fetch",{...s,endTimestamp:1e3*ki(),response:t}),t)),(t=>{throw Wo("fetch",{...s,endTimestamp:1e3*ki(),error:t}),Ko(t)&&void 0===t.stack&&(t.stack=o,mi(t,"framesToPop",1)),t}))}}))}(0,e)))}function Ac(t,e){return!!t&&"object"==typeof t&&!!t[e]}function Cc(t){return"string"==typeof t?t:t?Ac(t,"url")?t.url:t.toString?t.toString():"":""}const Nc=wo;const Pc=wo;let Dc=0;function Ic(){return Dc>0}function Mc(t,e={},n){if("function"!=typeof t)return t;try{const e=t.__sentry_wrapped__;if(e)return"function"==typeof e?e:t;if(yi(t))return t}catch(s){return t}const r=function(){const n=Array.prototype.slice.call(arguments);try{const r=n.map((t=>Mc(t,e)));return t.apply(this,r)}catch(r){throw Dc++,setTimeout((()=>{Dc--})),function(...t){const e=Ki(Vo());if(2===t.length){const[n,r]=t;return n?e.withSetScope(n,r):e.withScope(r)}e.withScope(t[0])}((t=>{var s;t.addEventProcessor((t=>(e.mechanism&&(Ti(t,void 0),Li(t,e.mechanism)),t.extra={...t.extra,arguments:n},t))),s=r,Yi().captureException(s,void 0)})),r}};try{for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])}catch(o){}gi(r,t),mi(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>t.name})}catch(o){}return r}const jc="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function $c(t,e){const n=Wc(t,e),r={type:Hc(e),value:Gc(e)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Uc(t,e,n,r){const s=Qi(),o=s&&s.getOptions().normalizeDepth,i=function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];if(n instanceof Error)return n}return}(e),a={__serialized__:ba(e,o)};if(i)return{exception:{values:[$c(t,i)]},extra:a};const c={exception:{values:[{type:ri(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:Jc(e,{isUnhandledRejection:r})}]},extra:a};if(n){const e=Wc(t,n);e.length&&(c.exception.values[0].stacktrace={frames:e})}return c}function Fc(t,e){return{exception:{values:[$c(t,e)]}}}function Wc(t,e){const n=e.stacktrace||e.stack||"",r=function(t){if(t&&Bc.test(t.message))return 1;return 0}(e),s=function(t){if("number"==typeof t.framesToPop)return t.framesToPop;return 0}(e);try{return t(n,r,s)}catch(o){}return[]}const Bc=/Minified React error #\d+;/i;function qc(t){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&t instanceof WebAssembly.Exception}function Hc(t){const e=t&&t.name;if(!e&&qc(t)){return t.message&&Array.isArray(t.message)&&2==t.message.length?t.message[0]:"WebAssembly.Exception"}return e}function Gc(t){const e=t&&t.message;return e?e.error&&"string"==typeof e.error.message?e.error.message:qc(t)&&Array.isArray(t.message)&&2==t.message.length?t.message[1]:e:"No error message"}function Vc(t,e,n,r,s){let o;if(Xo(e)&&e.error){return Fc(t,e.error)}if(Qo(e)||Yo(e,"DOMException")){const s=e;if("stack"in e)o=Fc(t,e);else{const e=s.name||(Qo(s)?"DOMError":"DOMException"),i=s.message?`${e}: ${s.message}`:e;o=zc(t,i,n,r),Ti(o,i)}return"code"in s&&(o.tags={...o.tags,"DOMException.code":`${s.code}`}),o}if(Ko(e))return Fc(t,e);if(ni(e)||ri(e)){return o=Uc(t,e,n,s),Li(o,{synthetic:!0}),o}return o=zc(t,e,n,r),Ti(o,`${e}`),Li(o,{synthetic:!0}),o}function zc(t,e,n,r){const s={};if(r&&n){const r=Wc(t,n);r.length&&(s.exception={values:[{value:e,stacktrace:{frames:r}}]})}if(ti(e)){const{__sentry_template_string__:t,__sentry_template_values__:n}=e;return s.logentry={message:t,params:n},s}return s.message=e,s}function Jc(t,{isUnhandledRejection:e}){const n=function(t,e=40){const n=Object.keys(vi(t));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return li(r,e);for(let s=n.length;s>0;s--){const t=n.slice(0,s).join(", ");if(!(t.length>e))return s===n.length?t:li(t,e)}return""}(t),r=e?"promise rejection":"exception";if(Xo(t))return`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``;if(ri(t)){return`Event \`${function(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(e){}}(t)}\` (type=${t.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${n}`}class Kc extends Qa{constructor(t){const e={parentSpanIsAlwaysRootSpan:!0,...t};!function(t,e,n=[e],r="npm"){const s=t._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${e}`,packages:n.map((t=>({name:`${r}:@sentry/${t}`,version:Eo}))),version:Eo}),t._metadata=s}(e,"browser",["browser"],Pc.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&Pc.document&&Pc.document.addEventListener("visibilitychange",(()=>{"hidden"===Pc.document.visibilityState&&this._flushOutcomes()}))}eventFromException(t,e){return function(t,e,n,r){const s=Vc(t,e,n&&n.syntheticException||void 0,r);return Li(s),s.level="error",n&&n.event_id&&(s.event_id=n.event_id),Ni(s)}(this._options.stackParser,t,e,this._options.attachStacktrace)}eventFromMessage(t,e="info",n){return function(t,e,n="info",r,s){const o=zc(t,e,r&&r.syntheticException||void 0,s);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),Ni(o)}(this._options.stackParser,t,e,n,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled())return void(jc&&To.warn("SDK not enabled, will not capture user feedback."));const e=function(t,{metadata:e,tunnel:n,dsn:r}){const s={event_id:t.event_id,sent_at:(new Date).toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:ga(r)}},o=function(t){return[{type:"user_report"},t]}(t);return wa(s,[o])}(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(e)}_prepareEvent(t,e,n){return t.platform=t.platform||"javascript",super._prepareEvent(t,e,n)}}const Yc="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Xc=wo;let Qc,Zc,tu,eu;function nu(){if(!Xc.document)return;const t=Wo.bind(null,"dom"),e=ru(t,!0);Xc.document.addEventListener("click",e,!1),Xc.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((e=>{const n=Xc[e]&&Xc[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(fi(n,"addEventListener",(function(e){return function(n,r,s){if("click"===n||"keypress"==n)try{const r=this,o=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},i=o[n]=o[n]||{refCount:0};if(!i.handler){const r=ru(t);i.handler=r,e.call(this,n,r,s)}i.refCount++}catch(o){}return e.call(this,n,r,s)}})),fi(n,"removeEventListener",(function(t){return function(e,n,r){if("click"===e||"keypress"==e)try{const n=this,s=n.__sentry_instrumentation_handlers__||{},o=s[e];o&&(o.refCount--,o.refCount<=0&&(t.call(this,e,o.handler,r),o.handler=void 0,delete s[e]),0===Object.keys(s).length&&delete n.__sentry_instrumentation_handlers__)}catch(s){}return t.call(this,e,n,r)}})))}))}function ru(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(t){try{return t.target}catch(e){return null}}(n);if(function(t,e){return"keypress"===t&&(!e||!e.tagName||"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName&&!e.isContentEditable)}(n.type,r))return;mi(n,"_sentryCaptured",!0),r&&!r._sentryId&&mi(r,"_sentryId",xi());const s="keypress"===n.type?"input":n.type;if(!function(t){if(t.type!==Zc)return!1;try{if(!t.target||t.target._sentryId!==tu)return!1}catch(e){}return!0}(n)){t({event:n,name:s,global:e}),Zc=n.type,tu=r?r._sentryId:void 0}clearTimeout(Qc),Qc=Xc.setTimeout((()=>{tu=void 0,Zc=void 0}),1e3)}}function su(t){const e="history";Uo(e,t),Fo(e,ou)}function ou(){if(!function(){const t=Nc.chrome,e=t&&t.app&&t.app.runtime,n="history"in Nc&&!!Nc.history.pushState&&!!Nc.history.replaceState;return!e&&n}())return;const t=Xc.onpopstate;function e(t){return function(...e){const n=e.length>2?e[2]:void 0;if(n){const t=eu,e=String(n);eu=e;Wo("history",{from:t,to:e})}return t.apply(this,e)}}Xc.onpopstate=function(...e){const n=Xc.location.href,r=eu;eu=n;if(Wo("history",{from:r,to:n}),t)try{return t.apply(this,e)}catch(s){}},fi(Xc.history,"pushState",e),fi(Xc.history,"replaceState",e)}const iu={};function au(t){iu[t]=void 0}const cu="__sentry_xhr_v3__";function uu(){if(!Xc.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(t,e,n){const r=1e3*ki(),s=Zo(n[0])?n[0].toUpperCase():void 0,o=function(t){if(Zo(t))return t;try{return t.toString()}catch(e){}return}(n[1]);if(!s||!o)return t.apply(e,n);e[cu]={method:s,url:o,request_headers:{}},"POST"===s&&o.match(/sentry_key/)&&(e.__sentry_own_request__=!0);const i=()=>{const t=e[cu];if(t&&4===e.readyState){try{t.status_code=e.status}catch(n){}Wo("xhr",{endTimestamp:1e3*ki(),startTimestamp:r,xhr:e})}};return"onreadystatechange"in e&&"function"==typeof e.onreadystatechange?e.onreadystatechange=new Proxy(e.onreadystatechange,{apply:(t,e,n)=>(i(),t.apply(e,n))}):e.addEventListener("readystatechange",i),e.setRequestHeader=new Proxy(e.setRequestHeader,{apply(t,e,n){const[r,s]=n,o=e[cu];return o&&Zo(r)&&Zo(s)&&(o.request_headers[r.toLowerCase()]=s),t.apply(e,n)}}),t.apply(e,n)}}),t.send=new Proxy(t.send,{apply(t,e,n){const r=e[cu];if(!r)return t.apply(e,n);void 0!==n[0]&&(r.body=n[0]);return Wo("xhr",{startTimestamp:1e3*ki(),xhr:e}),t.apply(e,n)}})}function lu(t,e=function(t){const e=iu[t];if(e)return e;let n=Xc[t];if(Tc(n))return iu[t]=n.bind(Xc);const r=Xc.document;if(r&&"function"==typeof r.createElement)try{const e=r.createElement("iframe");e.hidden=!0,r.head.appendChild(e);const s=e.contentWindow;s&&s[t]&&(n=s[t]),r.head.removeChild(e)}catch(s){Yc&&To.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,s)}return n?iu[t]=n.bind(Xc):n}("fetch")){let n=0,r=0;return sc(t,(function(s){const o=s.body.length;n+=o,r++;const i={body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};if(!e)return au("fetch"),Pi("No fetch implementation available");try{return e(t.url,i).then((t=>(n-=o,r--,{statusCode:t.status,headers:{"x-sentry-rate-limits":t.headers.get("X-Sentry-Rate-Limits"),"retry-after":t.headers.get("Retry-After")}})))}catch(a){return au("fetch"),n-=o,r--,Pi(a)}}))}function du(t,e,n,r){const s={filename:t,function:"<anonymous>"===e?Lo:e,in_app:!0};return void 0!==n&&(s.lineno=n),void 0!==r&&(s.colno=r),s}const hu=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,pu=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,fu=/\((\S*)(?::(\d+))(?::(\d+))\)/,mu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,gu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,yu=No(...[[30,t=>{const e=hu.exec(t);if(e){const[,t,n,r]=e;return du(t,Lo,+n,+r)}const n=pu.exec(t);if(n){if(n[2]&&0===n[2].indexOf("eval")){const t=fu.exec(n[2]);t&&(n[2]=t[1],n[3]=t[2],n[4]=t[3])}const[t,e]=vu(n[1]||Lo,n[2]);return du(e,t,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,t=>{const e=mu.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const t=gu.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}let t=e[3],n=e[1]||Lo;return[n,t]=vu(n,t),du(t,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]]),vu=(t,e)=>{const n=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return n||r?[-1!==t.indexOf("@")?t.split("@")[0]:Lo,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},_u=1024,bu=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:"Breadcrumbs",setup(t){var n;e.console&&function(t){const e="console";Uo(e,t),Fo(e,_c)}(function(t){return function(e){if(Qi()!==t)return;const n={category:"console",data:{arguments:e.args,logger:"console"},level:bc(e.level),message:di(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;n.message=`Assertion failed: ${di(e.args.slice(1)," ")||"console.assert"}`,n.data.arguments=e.args.slice(1)}ac(n,{input:e.args,level:e.level})}}(t)),e.dom&&(n=function(t,e){return function(n){if(Qi()!==t)return;let r,s,o="object"==typeof e?e.serializeAttribute:void 0,i="object"==typeof e&&"number"==typeof e.maxStringLength?e.maxStringLength:void 0;i&&i>_u&&(jc&&To.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${i} was configured. Sentry will use 1024 instead.`),i=_u),"string"==typeof o&&(o=[o]);try{const t=n.event,e=function(t){return!!t&&!!t.target}(t)?t.target:t;r=ci(e,{keyAttrs:o,maxStringLength:i}),s=function(t){if(!ai.HTMLElement)return null;let e=t;for(let n=0;n<5;n++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}(e)}catch(c){r="<unknown>"}if(0===r.length)return;const a={category:`ui.${n.name}`,message:r};s&&(a.data={"ui.component_name":s}),ac(a,{event:n.event,name:n.name,global:n.global})}}(t,e.dom),Uo("dom",n),Fo("dom",nu)),e.xhr&&function(t){Uo("xhr",t),Fo("xhr",uu)}(function(t){return function(e){if(Qi()!==t)return;const{startTimestamp:n,endTimestamp:r}=e,s=e.xhr[cu];if(!n||!r||!s)return;const{method:o,url:i,status_code:a,body:c}=s,u={method:o,url:i,status_code:a},l={xhr:e.xhr,input:c,startTimestamp:n,endTimestamp:r};ac({category:"xhr",data:u,type:"http",level:xc(a)},l)}}(t)),e.fetch&&Lc(function(t){return function(e){if(Qi()!==t)return;const{startTimestamp:n,endTimestamp:r}=e;if(r&&(!e.fetchData.url.match(/sentry_key/)||"POST"!==e.fetchData.method))if(e.error){ac({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args,startTimestamp:n,endTimestamp:r})}else{const t=e.response,s={...e.fetchData,status_code:t&&t.status},o={input:e.args,response:t,startTimestamp:n,endTimestamp:r};ac({category:"fetch",data:s,type:"http",level:xc(s.status_code)},o)}}}(t)),e.history&&su(function(t){return function(e){if(Qi()!==t)return;let n=e.from,r=e.to;const s=vc(Pc.location.href);let o=n?vc(n):void 0;const i=vc(r);o&&o.path||(o=s),s.protocol===i.protocol&&s.host===i.host&&(r=i.relative),s.protocol===o.protocol&&s.host===o.host&&(n=o.relative),ac({category:"navigation",data:{from:n,to:r}})}}(t)),e.sentry&&t.on("beforeSendEvent",function(t){return function(e){Qi()===t&&ac({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:Oi(e)},{event:e})}}(t))}}};const Eu=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],wu=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:"BrowserApiErrors",setupOnce(){e.setTimeout&&fi(Pc,"setTimeout",Su),e.setInterval&&fi(Pc,"setInterval",Su),e.requestAnimationFrame&&fi(Pc,"requestAnimationFrame",ku),e.XMLHttpRequest&&"XMLHttpRequest"in Pc&&fi(XMLHttpRequest.prototype,"send",xu);const t=e.eventTarget;if(t){(Array.isArray(t)?t:Eu).forEach(Ru)}}}};function Su(t){return function(...e){const n=e[0];return e[0]=Mc(n,{mechanism:{data:{function:Io(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function ku(t){return function(e){return t.apply(this,[Mc(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Io(t)},handled:!1,type:"instrument"}})])}}function xu(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((t=>{t in n&&"function"==typeof n[t]&&fi(n,t,(function(e){const n={mechanism:{data:{function:t,handler:Io(e)},handled:!1,type:"instrument"}},r=yi(e);return r&&(n.mechanism.data.handler=Io(r)),Mc(e,n)}))})),t.apply(this,e)}}function Ru(t){const e=Pc,n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(fi(n,"addEventListener",(function(e){return function(n,r,s){try{"function"==typeof r.handleEvent&&(r.handleEvent=Mc(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Io(r),target:t},handled:!1,type:"instrument"}}))}catch(o){}return e.apply(this,[n,Mc(r,{mechanism:{data:{function:"addEventListener",handler:Io(r),target:t},handled:!1,type:"instrument"}}),s])}})),fi(n,"removeEventListener",(function(t){return function(e,n,r){const s=n;try{const n=s&&s.__sentry_wrapped__;n&&t.call(this,e,n,r)}catch(o){}return t.call(this,e,s,r)}})))}const Ou=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(t){e.onerror&&(!function(t){!function(t){const e="error";Uo(e,t),Fo(e,qo)}((e=>{const{stackParser:n,attachStacktrace:r}=Lu();if(Qi()!==t||Ic())return;const{msg:s,url:o,line:i,column:a,error:c}=e,u=function(t,e,n,r){const s=t.exception=t.exception||{},o=s.values=s.values||[],i=o[0]=o[0]||{},a=i.stacktrace=i.stacktrace||{},c=a.frames=a.frames||[],u=isNaN(parseInt(r,10))?void 0:r,l=isNaN(parseInt(n,10))?void 0:n,d=Zo(e)&&e.length>0?e:function(){try{return ai.document.location.href}catch(t){return""}}();0===c.length&&c.push({colno:u,filename:d,function:Lo,in_app:!0,lineno:l});return t}(Vc(n,c||s,void 0,r,!1),o,i,a);u.level="error",Fa(u,{originalException:c,mechanism:{handled:!1,type:"onerror"}})}))}(t),Tu("onerror")),e.onunhandledrejection&&(!function(t){!function(t){const e="unhandledrejection";Uo(e,t),Fo(e,Go)}((e=>{const{stackParser:n,attachStacktrace:r}=Lu();if(Qi()!==t||Ic())return;const s=function(t){if(ei(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(e){}return t}(e),o=ei(s)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`}]}}:Vc(n,s,void 0,r,!0);o.level="error",Fa(o,{originalException:s,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}(t),Tu("onunhandledrejection"))}}};function Tu(t){jc&&To.log(`Global Handler attached: ${t}`)}function Lu(){const t=Qi();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const Au=()=>({name:"HttpContext",preprocessEvent(t){if(!Pc.navigator&&!Pc.location&&!Pc.document)return;const e=t.request&&t.request.url||Pc.location&&Pc.location.href,{referrer:n}=Pc.document||{},{userAgent:r}=Pc.navigator||{},s={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...t.request,...e&&{url:e},headers:s};t.request=o}}),Cu=(t={})=>{const e=t.limit||5,n=t.key||"cause";return{name:"LinkedErrors",preprocessEvent(t,r,s){const o=s.getOptions();fc($c,o.stackParser,o.maxValueLength,n,e,t,r)}}};function Nu(t,e){const n="********",r=new RegExp(e,"g"),s=t.replace(r,n),o=new RegExp("&token=[^&]*","gi");return s.replace(o,`&token=${n}`)}var Pu=(t=>(t.LOGS="logs",t.WARNINGS="warnings",t.ERRORS="errors",t))(Pu||{}),Du=(t=>(t.EMAIL="email",t.COMMENTS="comments",t))(Du||{});const Iu=window.AutoUpgradeVariables.admin_dir,Mu="feedbackModal";function ju(t,e,n={},r="error"){[{key:Pu.LOGS,filename:"logs.txt"},{key:Pu.WARNINGS,filename:"summary_warnings.txt"},{key:Pu.ERRORS,filename:"summary_errors.txt"}].forEach((({key:t,filename:n})=>{e.logs[t]&&Yi().addAttachment({filename:n,data:e.logs[t],contentType:"text/plain"})})),e.other.forEach(((t,e)=>{Yi().addAttachment({filename:e,data:t})}));const s=Nu(window.location.href,Iu),o=Fa({message:t,level:r,tags:{url:s,source:Mu,phpVersion:window.AutoUpgradeVariables.php_version,anonymousId:window.AutoUpgradeVariables.anonymous_id}});(n.email||n.comments)&&function(t,e={},n=Yi()){const{message:r,name:s,email:o,url:i,source:a,associatedEventId:c,tags:u}=t,l={contexts:{feedback:Ei({contact_email:o,name:s,message:r,url:i,source:a,associated_event_id:c})},type:"feedback",level:"info",tags:u},d=n&&n.getClient()||Qi();d&&d.emit("beforeSendFeedback",l,e),n.captureEvent(l,e)}({associatedEventId:o,email:n.email,message:n.comments??""},{captureContext:{tags:{url:s,source:Mu,phpVersion:window.AutoUpgradeVariables.php_version,anonymousId:window.AutoUpgradeVariables.anonymous_id}}}),Yi().clearAttachments()}!function(t={}){const e=function(t={}){const e={defaultIntegrations:[hc(),lc(),wu(),bu(),Ou(),Cu(),Ec(),Au()],release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:Pc.SENTRY_RELEASE&&Pc.SENTRY_RELEASE.id?Pc.SENTRY_RELEASE.id:void 0,autoSessionTracking:!0,sendClientReports:!0};return null==t.defaultIntegrations&&delete t.defaultIntegrations,{...e,...t}}(t);if(!e.skipBrowserExtensionCheck&&function(){const t=void 0!==Pc.window&&Pc;if(!t)return!1;const e=t[t.chrome?"chrome":"browser"],n=e&&e.runtime&&e.runtime.id,r=Pc.location&&Pc.location.href||"",s=!!n&&Pc===Pc.top&&["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"].some((t=>r.startsWith(`${t}//`))),o=void 0!==t.nw;return!!n&&!s&&!o}())return void Oo((()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}));jc&&(Oc()||To.warn("No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill."));const n={...e,stackParser:(r=e.stackParser||yu,Array.isArray(r)?No(...r):r),integrations:za(e),transport:e.transport||lu};var r;const s=ec(Kc,n);e.autoSessionTracking&&function(){if(void 0===Pc.document)return void(jc&&To.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));Wa({ignoreDuration:!0}),Ha(),su((({from:t,to:e})=>{void 0!==t&&t!==e&&(Wa({ignoreDuration:!0}),Ha())}))}()}({dsn:"https://eae192966a8d79509154c65c317a7e5d@o298402.ingest.us.sentry.io/4507254110552064",release:`v${window.AutoUpgradeVariables.module_version}`,sendDefaultPii:!1,beforeSend(t){var e,n;return(null==(e=t.tags)?void 0:e.source)!==Mu?null:((null==(n=t.request)?void 0:n.url)&&(t.request.url=Nu(window.location.href,Iu)),t)},beforeBreadcrumb:t=>(["url","from","to"].forEach((e=>{var n;(null==(n=t.data)?void 0:n[e])&&(t.data[e]=Nu(t.data[e],Iu))})),t)});class $u extends mo{constructor(){super(...arguments),Ye(this,De),ze(this,"formId","form-error-feedback"),ze(this,"mount",(()=>{this.form.addEventListener("submit",this.onSubmit);this.form.querySelector("#errorMessage").value=Ke(this,De,Ie)})),ze(this,"onSubmit",(async t=>{var e;t.preventDefault();const n={logs:Qe(this,De,Me).call(this),other:new Map},r=null==(e=document.getElementById(Cs.externalAdditionalContentsPanelId))?void 0:e.textContent;r&&n.other.set("response_raw.txt",r);const s=Qe(this,De,je).call(this,t.target);ju(Ke(this,De,Ie),n,s),this.dispatchDialogContainerOkEvent(t)}))}get form(){const t=document.forms.namedItem(this.formId);if(!t)throw new Error("Form not found");return t}}De=new WeakSet,Ie=function(){var t;const e=null==(t=js.getErrors().pop())?void 0:t.message;if(!e)throw new Error("No error message found to send");return e},Me=function(){return{logs:ro(js.getLogs()),warnings:ro(js.getWarnings()),errors:ro(js.getErrors())}},je=function(t){const e=new FormData(t),n={};return Object.values(Du).forEach((t=>{const r=e.get(t);r&&"string"==typeof r&&(n[t]=r)})),n};$e=new WeakMap,Ue=new WeakMap,Fe=new WeakSet,We=function(t){let e=null;return Object.values(tn).forEach((n=>{const r=tn[n];Ke(this,Ue)[r][t]&&(e=r)})),e||console.debug(`No matching script in script types found for script with ID: ${t}`),e};Be=new WeakMap,qe=new WeakMap,He=new WeakMap;const Uu=new class{constructor(){ze(this,"analytics"),ze(this,"track",((t,e)=>{this.analytics.track(t,{module:"autoupgrade",...Ke(this,qe).call(this),...e},{page:Ke(this,He).call(this)})})),Ye(this,Be,(()=>{document.addEventListener("click",(t=>{var e;const n=null==(e=t.target)?void 0:e.closest("[data-au-tracking]");if(n){const t=n.dataset.auTracking;this.track(`[SUE] ${t}`)}}))})),Ye(this,qe,(()=>({module:"autoupgrade",autoupgrade_version:window.AutoUpgradeVariables.module_version,php_version:window.AutoUpgradeVariables.php_version,ps_version:window.AutoUpgradeVariables.ps_version,bo_language:window.AutoUpgradeVariables.bo_language,bo_timezone:window.AutoUpgradeVariables.bo_timezone}))),Ye(this,He,(()=>{const t=window.AutoUpgradeVariables.admin_dir;return{path:Nu(window.location.pathname,t),referrer:Nu(document.referrer,t),url:Nu(window.location.href,t)}})),this.analytics=Ze.load({writeKey:"RM87m03McDSL4Fvm3GJ3piBPbAL3Fa2i"},{disableClientPersistence:!0}),this.analytics.identify(window.AutoUpgradeVariables.anonymous_id),Ke(this,Be).call(this)}},Fu=new class{constructor(){Ye(this,v),Qe(this,v,w).call(this),this.getCurrentRoute()||this.setNewRoute("home-page"),window.addEventListener("popstate",(()=>Qe(this,v,E).call(this)))}getCurrentRoute(){return Qe(this,v,b).call(this).get("route")}setNewRoute(t){const e=Qe(this,v,b).call(this);e.set("route",t);const n=`${Qe(this,v,_).call(this).pathname}?${e.toString()}`;window.history.pushState(null,"",n)}},Wu=new Hs,Bu=new class{constructor(){Ye(this,Fe),Ye(this,$e,{[tn.PAGE]:void 0,[tn.DIALOG]:void 0}),Ye(this,Ue,{[tn.PAGE]:{"home-page":Gs,"update-page-version-choice":Js,"update-page-update-options":Ks,"update-page-backup-options":Ys,"update-page-backup":co,"update-page-update":uo,"update-page-post-update":lo,"restore-page-backup-selection":ho,"restore-page-restore":po,"restore-page-post-restore":fo,"error-page":Fs},[tn.DIALOG]:{"restore-backup-dialog":go,"delete-backup-dialog":yo,"start-update-dialog":vo,"start-backup-dialog":_o,"send-error-report-dialog":$u}});const t=Fu.getCurrentRoute();t&&this.loadScript(t)}loadScript(t){const e=Qe(this,Fe,We).call(this,t);if(!e)return console.debug(`No matching class found for ID: ${t}`),void(Ke(this,$e)[tn.PAGE]||this.loadScript("error-page"));const n=Ke(this,Ue)[e][t];try{void 0!==Ke(this,$e)[e]&&this.unloadScriptType(e),Ke(this,$e)[e]=new n,Ke(this,$e)[e].mount()}catch(r){console.error(`Failed to load script with ID ${t}:`,r)}}unloadScriptType(t){var e;null==(e=Ke(this,$e)[t])||e.beforeDestroy(),Ke(this,$e)[t]=void 0}};